From d5ef04cf77b0929cfcd0dc98cf9fbbbd955ba3d4 Mon Sep 17 00:00:00 2001 From: chenhongtao Date: Tue, 1 Aug 2023 18:02:13 +0800 Subject: [PATCH] fix: cannot get dark png when try to get front png Log: --- src/service/modules/api/themethumb.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/service/modules/api/themethumb.cpp b/src/service/modules/api/themethumb.cpp index 2520c3b..6f49b49 100644 --- a/src/service/modules/api/themethumb.cpp +++ b/src/service/modules/api/themethumb.cpp @@ -14,6 +14,9 @@ #include #include +#include +using Dtk::Gui::DGuiApplicationHelper; + const int width = 320; const int height = 70; const int baseCursorSize = 24; @@ -366,7 +369,8 @@ QString getGlobal(QString id, QString descFile) keyFile.loadFile(descFile); QStringList example = keyFile.getStrList("Deepin Theme", "Example"); if (!example.isEmpty()) { - QString path = example.first(); + bool isdark = DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::ColorType::DarkType; + QString path = isdark ? example.last() : example.first(); QFileInfo file(path); if (file.isRelative()) { QFileInfo themefile(descFile);