OTHER: Fix glitch with to short volume sliders

Some XMMS skins have too short Volume slider backgrounds
(66 pixel instead of 68)
This commit is contained in:
Thomas Frauendorfer 2009-07-13 21:25:38 +02:00
parent 8aca0ba576
commit 7b5c9d2a82
2 changed files with 3 additions and 8 deletions

View file

@ -621,7 +621,7 @@ Skin::BuildSliders (void)
if (img.isNull ())
return false;
for (int i = 0; i <= 27; i++) {
list << img.copy(0, i*15, 68, 13);
list << img.copy(0, i*15, qMin (68, img.width()), 13);
}
m_backgrounds[SLIDER_VOLUMEBAR_BGS] = list;

View file

@ -132,13 +132,8 @@ PixmapSlider::paintEvent (QPaintEvent *event)
if (!m_backgrounds.isEmpty ()) {
int bg_idx = backgroundIndex ();
QPixmap bg = m_backgrounds[bg_idx];
// only redraw the complete background, if the index changed
if (bg_idx == m_background_index) {
p.drawPixmap (event->rect (), bg, bg.rect ());
} else {
m_background_index = bg_idx;
p.drawPixmap (rect (), bg, bg.rect ());
}
m_background_index = bg_idx;
p.drawPixmap (0, 0, bg.width(), bg.height(), bg);
}
// draw slider
QPixmap *slider = isSliderDown () ? &m_pressed : &m_normal;