mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-07 15:32:13 +00:00
Fix Logo Color for Dark Theme
This commit is contained in:
parent
c92ed51b65
commit
8241b09e80
@ -127,7 +127,15 @@ void Configuration::setLocale(const QLocale &l)
|
|||||||
|
|
||||||
bool Configuration::windowColorIsDark()
|
bool Configuration::windowColorIsDark()
|
||||||
{
|
{
|
||||||
auto windowColor = QPalette().color(QPalette::Window).toRgb();
|
ColorFlags currentThemeColorFlags = getCurrentTheme()->flag;
|
||||||
|
if (currentThemeColorFlags == ColorFlags::LightFlag) {
|
||||||
|
return false;
|
||||||
|
} else if (currentThemeColorFlags == ColorFlags::DarkFlag) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QPalette &palette = qApp->palette();
|
||||||
|
auto windowColor = palette.color(QPalette::Window).toRgb();
|
||||||
return (windowColor.red() + windowColor.green() + windowColor.blue()) < 382;
|
return (windowColor.red() + windowColor.green() + windowColor.blue()) < 382;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,6 +284,15 @@ void Configuration::setTheme(int theme)
|
|||||||
emit colorsUpdated();
|
emit colorsUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CutterQtTheme *Configuration::getCurrentTheme()
|
||||||
|
{
|
||||||
|
int i = getTheme();
|
||||||
|
if (i < 0 || i >= kCutterQtThemesList.size()) {
|
||||||
|
i = 0;
|
||||||
|
setTheme(i);
|
||||||
|
}
|
||||||
|
return &kCutterQtThemesList[i];
|
||||||
|
}
|
||||||
|
|
||||||
QString Configuration::getLogoFile()
|
QString Configuration::getLogoFile()
|
||||||
{
|
{
|
||||||
|
@ -65,6 +65,8 @@ public:
|
|||||||
return s.value("ColorPalette", 0).toInt();
|
return s.value("ColorPalette", 0).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CutterQtTheme *getCurrentTheme();
|
||||||
|
|
||||||
QString getDirProjects();
|
QString getDirProjects();
|
||||||
void setDirProjects(const QString &dir);
|
void setDirProjects(const QString &dir);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user