Sliders (equalizer and posbar) now display the correct pixmaps when pressed

This commit is contained in:
Thomas Frauendorfer 2008-02-05 20:04:01 +01:00
parent ba27687590
commit 0da2995880
5 changed files with 7 additions and 11 deletions

View file

@ -28,14 +28,13 @@ PosButton::PosButton (QWidget *parent, uint normal, uint pressed) : Button (pare
m_slider = dynamic_cast<PosBar *>(parent);
setMinimumSize (29, 10);
setMaximumSize (29, 10);
m_moving = false;
}
void
PosButton::setPos (uint pos)
{
m_pos = pos;
if (!m_moving) {
if (!isDown ()) {
move (pos, 0);
}
}
@ -54,13 +53,13 @@ PosButton::mousePressEvent (QMouseEvent *event)
m_diffx = p.x();
m_diffy = p.y();
m_moving = true;
setDown (true);
}
void
PosButton::mouseReleaseEvent (QMouseEvent *event)
{
m_moving = false;
setDown (false);
float value = pos().x() / (float)(m_slider->width() - width());