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:
parent
8aca0ba576
commit
7b5c9d2a82
2 changed files with 3 additions and 8 deletions
|
@ -621,7 +621,7 @@ Skin::BuildSliders (void)
|
||||||
if (img.isNull ())
|
if (img.isNull ())
|
||||||
return false;
|
return false;
|
||||||
for (int i = 0; i <= 27; i++) {
|
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;
|
m_backgrounds[SLIDER_VOLUMEBAR_BGS] = list;
|
||||||
|
|
||||||
|
|
|
@ -132,13 +132,8 @@ PixmapSlider::paintEvent (QPaintEvent *event)
|
||||||
if (!m_backgrounds.isEmpty ()) {
|
if (!m_backgrounds.isEmpty ()) {
|
||||||
int bg_idx = backgroundIndex ();
|
int bg_idx = backgroundIndex ();
|
||||||
QPixmap bg = m_backgrounds[bg_idx];
|
QPixmap bg = m_backgrounds[bg_idx];
|
||||||
// only redraw the complete background, if the index changed
|
m_background_index = bg_idx;
|
||||||
if (bg_idx == m_background_index) {
|
p.drawPixmap (0, 0, bg.width(), bg.height(), bg);
|
||||||
p.drawPixmap (event->rect (), bg, bg.rect ());
|
|
||||||
} else {
|
|
||||||
m_background_index = bg_idx;
|
|
||||||
p.drawPixmap (rect (), bg, bg.rect ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// draw slider
|
// draw slider
|
||||||
QPixmap *slider = isSliderDown () ? &m_pressed : &m_normal;
|
QPixmap *slider = isSliderDown () ? &m_pressed : &m_normal;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue