annotate src/gui/theme.cc @ 230:2f5a9247e501

torrents: implement download button erg
author Paper <paper@paper.us.eu.org>
date Sat, 13 Jan 2024 09:42:02 -0500
parents adc20fa321c1
children ff0061e75f0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #include "core/config.h"
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #include "core/session.h"
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <QApplication>
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QFile>
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <QDebug>
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <QTextStream>
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <QStyleFactory>
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #ifdef MACOSX
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 # include "sys/osx/dark_theme.h"
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
10 #elif WIN32
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 # include "sys/win32/dark_theme.h"
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 #endif
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13
229
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
14 /* Weird quirks of this implementation:
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
15 * 1. Dark mode stuff in Qt changes a lot and Qt 5 and Qt 6 are massively different
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
16 * 2. Some widgets, i.e. QTabWidget, QTabBar, etc., just completely IGNORE the QPalette setting
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
17 * on different platforms and the only way to fix it is by using Fusion
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
18 * 3. Windows dark mode support in Qt 6.5 (with Fusion) is completely unavoidable
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
19 */
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 namespace Theme {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 Theme::Theme(Themes theme) {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 this->theme = theme;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
27 Themes Theme::GetTheme() const {
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 return theme;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
31 bool Theme::IsInDarkTheme() const {
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32 if (theme != Themes::OS)
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 return (theme == Themes::DARK);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 #ifdef MACOSX
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 if (osx::DarkThemeAvailable())
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 return osx::IsInDarkTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37 #elif defined(WIN32)
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 if (win32::DarkThemeAvailable())
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 return win32::IsInDarkTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40 #endif
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 return (theme == Themes::DARK);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 void Theme::SetToDarkTheme() {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
45 /* macOS >= 10.14 has its own global dark theme,
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 use it :) */
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
47 #ifdef MACOSX
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48 if (osx::DarkThemeAvailable())
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 osx::SetToDarkTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 else
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
51 #elif defined(WIN32)
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
52 if (win32::DarkThemeAvailable())
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
53 win32::SetTitleBarsToBlack(true);
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 #endif
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 SetStyleSheet(Themes::DARK);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 void Theme::SetToLightTheme() {
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
59 #ifdef MACOSX
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60 if (osx::DarkThemeAvailable())
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61 osx::SetToLightTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
62 else
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
63 #elif defined(WIN32)
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
64 if (win32::DarkThemeAvailable())
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
65 win32::SetTitleBarsToBlack(false);
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
66 #endif
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
67 SetStyleSheet(Themes::LIGHT);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
70 Themes Theme::GetCurrentOSTheme() const {
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
71 #ifdef MACOSX
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
72 if (osx::DarkThemeAvailable())
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
73 return osx::IsInDarkTheme() ? Themes::DARK : Themes::LIGHT;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
74 #elif defined(WIN32)
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
75 if (win32::DarkThemeAvailable())
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76 return win32::IsInDarkTheme() ? Themes::DARK : Themes::LIGHT;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77 #endif
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
78 /* Currently OS detection only supports Windows and macOS.
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
79 Please don't be shy if you're willing to port it to other OSes
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
80 (or desktop environments, or window managers) */
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
81 return Themes::LIGHT;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
82 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
83
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
84 /* this function is private, and should stay that way */
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
85 void Theme::SetStyleSheet(Themes theme) {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
86 switch (theme) {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
87 case Themes::DARK: {
230
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
88 const QColor darkGray(53, 53, 53);
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
89 const QColor gray(128, 128, 128);
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
90 const QColor black(25, 25, 25);
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
91 const QColor blue(42, 130, 218);
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
92
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
93 QPalette pal(QApplication::style()->standardPalette());
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
94 pal.setColor(QPalette::Window, darkGray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
95 pal.setColor(QPalette::WindowText, Qt::white);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
96 pal.setColor(QPalette::Base, black);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
97 pal.setColor(QPalette::AlternateBase, darkGray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
98 pal.setColor(QPalette::ToolTipBase, blue);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
99 pal.setColor(QPalette::ToolTipText, Qt::white);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
100 pal.setColor(QPalette::Text, Qt::white);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
101 pal.setColor(QPalette::Button, darkGray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
102 pal.setColor(QPalette::ButtonText, Qt::white);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
103 pal.setColor(QPalette::Link, blue);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
104 pal.setColor(QPalette::Highlight, blue);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
105 pal.setColor(QPalette::HighlightedText, Qt::black);
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
106
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
107 pal.setColor(QPalette::Active, QPalette::Button, gray.darker());
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
108 pal.setColor(QPalette::Disabled, QPalette::ButtonText, gray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
109 pal.setColor(QPalette::Disabled, QPalette::WindowText, gray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
110 pal.setColor(QPalette::Disabled, QPalette::Text, gray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
111 pal.setColor(QPalette::Disabled, QPalette::Light, darkGray);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
112 qApp->setPalette(pal);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
113
229
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
114 #ifdef WIN32
230
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
115 qApp->setStyleSheet([]{
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
116 QFile f(":/dark.qss");
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
117 if (!f.exists())
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
118 return QStringLiteral("");
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
119 f.open(QFile::ReadOnly | QFile::Text);
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
120 QTextStream ts(&f);
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
121 return ts.readAll();
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
122 }());
229
adc20fa321c1 theme: force Fusion style on platforms other than Win32 or OS X
Paper <paper@paper.us.eu.org>
parents: 183
diff changeset
123 #endif
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
124 break;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
125 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
126 default:
230
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
127 /* this sucks, it relies on the standard palette which
2f5a9247e501 torrents: implement download button
Paper <paper@paper.us.eu.org>
parents: 229
diff changeset
128 * may or may not be a dark style itself. */
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
129 QPalette pal(QApplication::style()->standardPalette());
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
130 #ifdef WIN32 /* fuck you Qt 6 */
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
131 pal.setColor(QPalette::Window, QColor(0xF0, 0xF0, 0xF0));
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
132 #endif
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
133 pal.setColor(QPalette::WindowText, Qt::black);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
134 pal.setColor(QPalette::ToolTipText, Qt::black);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
135 pal.setColor(QPalette::Text, Qt::black);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
136 pal.setColor(QPalette::ButtonText, Qt::black);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
137 qApp->setPalette(pal);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
138
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
139 qApp->setStyleSheet("");
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
140 break;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
141 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
142 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
143
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
144 void Theme::SetTheme(Themes theme) {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
145 switch (theme) {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
146 case Themes::LIGHT:
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
147 SetToLightTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
148 break;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
149 case Themes::DARK:
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
150 SetToDarkTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
151 break;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
152 case Themes::OS:
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
153 if (GetCurrentOSTheme() == Themes::LIGHT)
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
154 SetToLightTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
155 else
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
156 SetToDarkTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
157 break;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
158 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
159 this->theme = theme;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
160 }
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
161
105
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
162 void Theme::RepaintCurrentTheme() {
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
163 Theme::SetTheme(theme);
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
164 }
6d8da6e64d61 theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents: 102
diff changeset
165
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
166 } // namespace DarkTheme