Skip to content

Commit 23d6df9

Browse files
committed
dark/light theme follow the system
1 parent 4233ab2 commit 23d6df9

File tree

8 files changed

+80
-90
lines changed

8 files changed

+80
-90
lines changed

deb.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(_VERSION_MAJOR 0)
22
set(_VERSION_MINOR 6)
3-
set(_VERSION_PATCH 2)
3+
set(_VERSION_PATCH 3)
44

55
set(CPACK_GENERATOR "DEB")
66

debian/doc/changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* 0.6.3
2+
- Auto dark & light theme
3+
- Bug fix
14
* 0.6.1
25
- UI improvement
36
- rounded corner for the selected background of the menu items

frame/frame.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<file alias="maximum.svg">resources/icons/maximum.svg</file>
88
<file alias="minimum.svg">resources/icons/minimum.svg</file>
99
<file alias="linux.svg">resources/icons/linux.svg</file>
10+
<file alias="linux-light.svg">resources/icons/linux-light.svg</file>
1011
<file alias="reset.svg">resources/icons/reset.svg</file>
1112
<file alias="config.svg">resources/icons/config.svg</file>
1213
<file alias="doge.gif">resources/icons/doge.gif</file>

frame/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(int argc, char *argv[]) {
3131
app.setOrganizationName("septemberhx");
3232
app.setApplicationName("dde-top-panel");
3333
app.setApplicationDisplayName("DDE Top Panel");
34-
app.setApplicationVersion("0.6.2");
34+
app.setApplicationVersion("0.6.3");
3535
app.loadTranslator();
3636
app.setAttribute(Qt::AA_EnableHighDpiScaling, true);
3737
app.setAttribute(Qt::AA_UseHighDpiPixmaps, false);
Lines changed: 53 additions & 0 deletions
Loading

frame/resources/icons/linux.svg

Lines changed: 7 additions & 88 deletions
Loading

frame/util/CustomSettings.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
DGUI_USE_NAMESPACE
1212

1313
CustomSettings::CustomSettings() {
14+
this->defaultIconPathLight = ":/icons/linux.svg";
15+
this->defaultIconPathDark = ":/icons/linux-light.svg";
16+
1417
this->setDefaultPanelOpacity();
1518
this->setDefaultPanelBgColor();
1619

@@ -138,6 +141,14 @@ void CustomSettings::setActiveMinimizedIconPath(const QString &activeMinimizedIc
138141
}
139142

140143
const QString &CustomSettings::getActiveDefaultAppIconPath() const {
144+
if (this->isFollowSystemTheme()) {
145+
switch (DGuiApplicationHelper::instance()->themeType()) {
146+
case Dtk::Gui::DGuiApplicationHelper::DarkType:
147+
return this->defaultIconPathDark;
148+
case Dtk::Gui::DGuiApplicationHelper::LightType:
149+
return this->defaultIconPathLight;
150+
}
151+
}
141152
return activeDefaultAppIconPath;
142153
}
143154

frame/util/CustomSettings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ class CustomSettings : public QObject {
163163
QString activeMinimizedIconPath;
164164
QString activeDefaultAppIconPath;
165165

166+
QString defaultIconPathLight;
167+
QString defaultIconPathDark;
168+
166169
QColor defaultLightColor;
167170
QColor defaultDarkColor;
168171
};

0 commit comments

Comments
 (0)