From 7b5c9d2a82f09bd81b409a8df6fc7104cddcfb6c Mon Sep 17 00:00:00 2001 From: Thomas Frauendorfer Date: Mon, 13 Jul 2009 21:25:38 +0200 Subject: [PATCH] OTHER: Fix glitch with to short volume sliders Some XMMS skins have too short Volume slider backgrounds (66 pixel instead of 68) --- src/Skin.cpp | 2 +- src/widgets/pixmapslider.cpp | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Skin.cpp b/src/Skin.cpp index e32bd91..5cf568b 100644 --- a/src/Skin.cpp +++ b/src/Skin.cpp @@ -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; diff --git a/src/widgets/pixmapslider.cpp b/src/widgets/pixmapslider.cpp index 3830955..6c304d5 100644 --- a/src/widgets/pixmapslider.cpp +++ b/src/widgets/pixmapslider.cpp @@ -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;