aboutsummaryrefslogtreecommitdiff
path: root/src/qt/platformstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/platformstyle.cpp')
-rw-r--r--src/qt/platformstyle.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/qt/platformstyle.cpp b/src/qt/platformstyle.cpp
index 1d0605c903..2257c2ad4f 100644
--- a/src/qt/platformstyle.cpp
+++ b/src/qt/platformstyle.cpp
@@ -71,25 +71,28 @@ PlatformStyle::PlatformStyle(const QString &_name, bool _imagesOnButtons, bool _
name(_name),
imagesOnButtons(_imagesOnButtons),
colorizeIcons(_colorizeIcons),
- useExtraSpacing(_useExtraSpacing),
- singleColor(0,0,0),
- textColor(0,0,0)
+ useExtraSpacing(_useExtraSpacing)
+{
+}
+
+QColor PlatformStyle::TextColor() const
+{
+ return QApplication::palette().color(QPalette::WindowText);
+}
+
+QColor PlatformStyle::SingleColor() const
{
- // Determine icon highlighting color
if (colorizeIcons) {
const QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight));
const QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText));
const QColor colorText(QApplication::palette().color(QPalette::WindowText));
const int colorTextLightness = colorText.lightness();
- QColor colorbase;
- if (abs(colorHighlightBg.lightness() - colorTextLightness) < abs(colorHighlightFg.lightness() - colorTextLightness))
- colorbase = colorHighlightBg;
- else
- colorbase = colorHighlightFg;
- singleColor = colorbase;
+ if (abs(colorHighlightBg.lightness() - colorTextLightness) < abs(colorHighlightFg.lightness() - colorTextLightness)) {
+ return colorHighlightBg;
+ }
+ return colorHighlightFg;
}
- // Determine text color
- textColor = QColor(QApplication::palette().color(QPalette::WindowText));
+ return {0, 0, 0};
}
QImage PlatformStyle::SingleColorImage(const QString& filename) const