Some cleanups, file moves and changes in PlayStatus
This commit is contained in:
parent
a5e35d986e
commit
3f8ba378ad
10 changed files with 55 additions and 33 deletions
69
src/mainwindow/posbar.cpp
Normal file
69
src/mainwindow/posbar.cpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/**
|
||||
* This file is a part of Promoe, an XMMS2 Client.
|
||||
*
|
||||
* Copyright (C) 2005-2008 XMMS2 Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "XMMSHandler.h"
|
||||
#include "xplayback.h"
|
||||
|
||||
#include "PosBar.h"
|
||||
#include "Skin.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
PosBar::PosBar (QWidget *parent, uint bg, uint bnormal, uint bpressed)
|
||||
: PixmapSlider (parent)
|
||||
{
|
||||
Skin *skin = Skin::getInstance ();
|
||||
m_slider_normal = bnormal;
|
||||
m_slider_pressed = bpressed;
|
||||
m_bg = bg;
|
||||
|
||||
connect (skin, SIGNAL (skinChanged (Skin *)),
|
||||
this, SLOT (setPixmaps (Skin *)));
|
||||
|
||||
setFixedSize (248, 10);
|
||||
|
||||
setMinimum (0);
|
||||
setMaximum (0);
|
||||
|
||||
connect (this, SIGNAL (sliderMoved (int)),
|
||||
this, SLOT (seekMs (int)));
|
||||
|
||||
hide ();
|
||||
}
|
||||
|
||||
void
|
||||
PosBar::seekMs (int value)
|
||||
{
|
||||
XMMSHandler::getInstance ().xplayback ()->seekMs (value);
|
||||
}
|
||||
|
||||
void
|
||||
PosBar::setPixmaps (Skin *skin)
|
||||
{
|
||||
QPixmap pixmap = skin->getItem (m_bg);
|
||||
setBackground (pixmap);
|
||||
setFixedSize (248, pixmap.height ());
|
||||
|
||||
if ( !skin->getItem(m_slider_normal).isNull() &&
|
||||
!skin->getItem(m_slider_pressed).isNull()) {
|
||||
setSliders (skin->getItem(m_slider_normal),
|
||||
skin->getItem(m_slider_pressed));
|
||||
} else {
|
||||
setSliders (QPixmap (), QPixmap ());
|
||||
}
|
||||
|
||||
update ();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue