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());

View file

@ -35,7 +35,6 @@ class PosButton : public Button
private:
PosBar *m_slider;
bool m_moving;
uint m_pos;
uint m_diffx;
uint m_diffy;

View file

@ -54,8 +54,8 @@ Skin::BuildEqualizer (void)
m_items[EQ_WIN_BAR_POS_14+i] = img->copy (13+15*i, 229, 14, 63);
}
m_items[EQ_WIN_BAR_BTN_1] = img->copy (0, 164, 11, 11);
m_items[EQ_WIN_BAR_BTN_0] = img->copy (0, 176, 11, 11);
m_items[EQ_WIN_BAR_BTN_0] = img->copy (0, 164, 11, 11);
m_items[EQ_WIN_BAR_BTN_1] = img->copy (0, 176, 11, 11);
delete img;
} else {

View file

@ -184,7 +184,6 @@ SliderButton::SliderButton (QWidget *parent, uint normal, uint pressed,
m_slider = dynamic_cast<Slider *>(parent);
m_vertical = vertical;
m_diff = 0;
m_moving = false;
if (m_vertical) {
move(1, 0);
@ -202,14 +201,14 @@ SliderButton::mousePressEvent (QMouseEvent *event)
} else {
m_diff = x() - event->pos().x();
}
m_moving = true;
setDown (true);
}
void
SliderButton::mouseReleaseEvent (QMouseEvent *event)
{
m_moving = false;
setDown (false);
}

View file

@ -43,7 +43,6 @@ class SliderButton : public Button
Slider *m_slider;
bool m_vertical;
int m_diff;
bool m_moving;
};
class Slider : public PixWidget