comparison widgets/IconLoader.cpp @ 1452:8b7f797bca86 single-point

Make inversion configurable in settings
author Chris Cannam
date Fri, 03 May 2019 17:45:39 +0100
parents a9c2e791ab8d
children 705d1d979ae4
comparison
equal deleted inserted replaced
1451:f72fb7fac92a 1452:8b7f797bca86
19 #include <QApplication> 19 #include <QApplication>
20 #include <QPainter> 20 #include <QPainter>
21 #include <QPalette> 21 #include <QPalette>
22 #include <QFile> 22 #include <QFile>
23 #include <QSvgRenderer> 23 #include <QSvgRenderer>
24 #include <QSettings>
24 25
25 #include <vector> 26 #include <vector>
26 #include <set> 27 #include <set>
27 28
28 #include "base/Debug.h" 29 #include "base/Debug.h"
71 } 72 }
72 73
73 bool 74 bool
74 IconLoader::shouldInvert() const 75 IconLoader::shouldInvert() const
75 { 76 {
77 QSettings settings;
78 settings.beginGroup("IconLoader");
79 if (!settings.value("invert-icons-on-dark-background", true).toBool()) {
80 return false;
81 }
76 QColor bg = QApplication::palette().window().color(); 82 QColor bg = QApplication::palette().window().color();
77 bool darkBackground = (bg.red() + bg.green() + bg.blue() <= 384); 83 bool darkBackground = (bg.red() + bg.green() + bg.blue() <= 384);
78 return darkBackground; 84 return darkBackground;
79 } 85 }
80 86