Skip to content

Commit 11c00cd

Browse files
committed
Edit how qt system theme is used
Adds background color, overlay text/background color, distinct border for popups Fixes distinct elements of ui window having the same background colors (bars, widgets)
1 parent 3127a2d commit 11c00cd

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

qimgv/themestore.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,28 @@
33
ColorScheme ThemeStore::colorScheme(ColorSchemes name) {
44
BaseColorScheme base = {-1};
55
QPalette p;
6+
const int darken_mult = (p.window().color().valueF() <= 0.45) * 2 - 1;
67
switch(name) {
78
case COLORS_SYSTEM:
8-
case COLORS_CUSTOMIZED:
9-
base.folderview_topbar = p.window().color();
10-
base.widget = p.window().color();
11-
base.widget_border = p.window().color();
12-
base.folderview = p.base().color();
13-
base.text = p.text().color();
14-
base.icons = p.text().color();
15-
base.accent = p.highlight().color();
16-
base.scrollbar.setHsv(p.highlight().color().hue(),
17-
qBound(0, p.highlight().color().saturation() - 20, 240),
18-
qBound(0, p.highlight().color().value() - 35, 240));
9+
case COLORS_CUSTOMIZED:
10+
base.accent.setHsv(p.highlight().color().hue(),
11+
qBound(0, p.highlight().color().saturation() - 50 * darken_mult, 240),
12+
qBound(0, p.highlight().color().value() - 35 * darken_mult, 240));
13+
base.background = p.window().color();
14+
base.background_fullscreen = p.window().color();
15+
base.folderview = p.window().color();
16+
base.folderview_topbar = p.alternateBase().color();
17+
base.icons.setHsv(p.accent().color().hue(),
18+
qBound(0, p.accent().color().saturation() + 35 * darken_mult, 240),
19+
qBound(0, p.accent().color().value() - (p.accent().color().value() / 4) * darken_mult, 240));
20+
base.overlay = p.alternateBase().color();
21+
base.overlay_text = p.text().color();
22+
base.scrollbar.setHsv(p.alternateBase().color().hue(),
23+
qBound(0, p.alternateBase().color().saturation() - 20 * darken_mult, 240),
24+
qBound(0, p.alternateBase().color().value() + 15 * darken_mult, 240));
25+
base.text = p.windowText().color();
26+
base.widget = p.alternateBase().color();
27+
base.widget_border = p.accent().color();
1928
base.tid = static_cast<int>(name);
2029
break;
2130
case COLORS_LIGHT: // v2, works with w10 titlebars

0 commit comments

Comments
 (0)