1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-07 06:35:15 +01:00

changed variable name & comments added

This commit is contained in:
narunlifescience 2015-09-16 06:10:13 -05:00
parent af8cccc1cd
commit 785a7ee717
2 changed files with 6 additions and 4 deletions

View File

@ -198,7 +198,8 @@ Amarok::VolumeSlider::VolumeSlider(QWidget* parent, uint max)
m_pixmapInset(QPixmap(volumePixmapDraw ())) {
setFocusPolicy(Qt::NoFocus);
WindowText_color = palette().color(QPalette::WindowText);
// Store window text color to check theme change at paintEvent
m_previous_theme_text_color = palette().color(QPalette::WindowText);
// BEGIN Calculate handle animation pixmaps for mouse-over effect
QImage pixmapHandle(":volumeslider-handle.png");
@ -303,9 +304,10 @@ void Amarok::VolumeSlider::paintEvent(QPaintEvent*) {
const int padding = 7;
const int offset = int(double((width() - 2 * padding) * value()) / maximum());
if (WindowText_color != palette().color(QPalette::WindowText)) {
// If theme changed since last paintEvent, redraw the volume pixmap with new theme colors
if (m_previous_theme_text_color != palette().color(QPalette::WindowText)) {
m_pixmapInset = volumePixmapDraw();
WindowText_color = palette().color(QPalette::WindowText);
m_previous_theme_text_color = palette().color(QPalette::WindowText);
}
p.drawPixmap(0, 0, m_pixmapGradient, 0, 0, offset + padding, 0);

View File

@ -130,7 +130,7 @@ class VolumeSlider : public Slider {
QPixmap m_pixmapInset;
QPixmap m_pixmapGradient;
QColor WindowText_color;
QColor m_previous_theme_text_color;
QList<QPixmap> m_handlePixmaps;
};