From d40df83d0c893a6e307e1c4e043ef585e288ed41 Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Tue, 11 Jul 2017 20:50:14 +0200 Subject: [PATCH] Fix color of selected config button in light themes --- src/config/uicoloreditor.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config/uicoloreditor.cpp b/src/config/uicoloreditor.cpp index 8c03e156..5c9cc52e 100644 --- a/src/config/uicoloreditor.cpp +++ b/src/config/uicoloreditor.cpp @@ -133,19 +133,22 @@ void UIcolorEditor::updateButtonIcon() { m_lastButtonPressed->setIcon(Button::getIcon(m_buttonMainColor->getButtonType())); } +// visual update for the selected button void UIcolorEditor::changeLastButton(Button *b) { if (m_lastButtonPressed != b) { m_lastButtonPressed->setIcon(QIcon()); m_lastButtonPressed = b; + QString offStyle("QLabel { color : gray; }"); + if (b == m_buttonMainColor) { m_colorWheel->setColor(m_uiColor); - m_labelContrast->setStyleSheet("QLabel { color : gray; }"); - m_labelMain->setStyleSheet("QLabel { color : white; }"); + m_labelContrast->setStyleSheet(offStyle); + m_labelMain->setStyleSheet(styleSheet()); } else { m_colorWheel->setColor(m_contrastColor); - m_labelContrast->setStyleSheet("QLabel { color : white; }"); - m_labelMain->setStyleSheet("QLabel { color : gray; }"); + m_labelContrast->setStyleSheet(styleSheet()); + m_labelMain->setStyleSheet(offStyle); } b->setIcon(b->getIcon(m_buttonIconType)); }