From 97179bf42865c6c509de9db7059664b1697a5b0d Mon Sep 17 00:00:00 2001 From: yuanxing Date: Wed, 29 Nov 2023 09:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=B0=8F=E6=97=B6=E5=A4=A7=E4=BA=8E?= =?UTF-8?q?=E7=AD=89=E4=BA=8E=E6=99=9A=E4=B8=8A8=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E6=B7=B1=E8=89=B2=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...et-dark-theme-when-hour-greater-than.patch | 32 +++++++++++++++++++ kiran-cc-daemon.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0001-fix-appearance-set-dark-theme-when-hour-greater-than.patch diff --git a/0001-fix-appearance-set-dark-theme-when-hour-greater-than.patch b/0001-fix-appearance-set-dark-theme-when-hour-greater-than.patch new file mode 100644 index 0000000..0368888 --- /dev/null +++ b/0001-fix-appearance-set-dark-theme-when-hour-greater-than.patch @@ -0,0 +1,32 @@ +From 8988797c83a7fc95e552d5840bbb140a72738a18 Mon Sep 17 00:00:00 2001 +From: yuanxing +Date: Wed, 29 Nov 2023 09:04:59 +0800 +Subject: [PATCH] fix(appearance):set dark theme when hour greater than or + equal to 20 at night +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 当晚上小时大于等于8点,设置主题颜色为深色 + +Fixes #20784 +--- + plugins/appearance/appearance-manager.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/appearance/appearance-manager.cpp b/plugins/appearance/appearance-manager.cpp +index 4b67205..8573e6b 100644 +--- a/plugins/appearance/appearance-manager.cpp ++++ b/plugins/appearance/appearance-manager.cpp +@@ -207,7 +207,7 @@ void AppearanceManager::auto_switch_for_window_theme() + auto error_code = CCErrorCode::SUCCESS; + + // 下午8点之后到早上8点之前判定为晚上,使用深色主题,否则使用浅色主题 +- auto theme_name = (current_hour < 8 || current_hour > 20) ? APPEARANCE_DEFAULT_DARK_GTK_THEME : APPEARANCE_DEFAULT_LIGHT_GTK_THEME; ++ auto theme_name = (current_hour < 8 || current_hour >= 20) ? APPEARANCE_DEFAULT_DARK_GTK_THEME : APPEARANCE_DEFAULT_LIGHT_GTK_THEME; + if (!this->appearance_theme_.set_theme(std::make_pair(AppearanceThemeType::APPEARANCE_THEME_TYPE_GTK, theme_name), + error_code)) + { +-- +2.27.0 + diff --git a/kiran-cc-daemon.spec b/kiran-cc-daemon.spec index 1f0aaaa..5dd0869 100644 --- a/kiran-cc-daemon.spec +++ b/kiran-cc-daemon.spec @@ -1,6 +1,6 @@ Name: kiran-cc-daemon Version: 2.5.1 -Release: 30 +Release: 31 Summary: DBus daemon for Kiran Desktop License: MulanPSL-2.0 @@ -32,6 +32,7 @@ Patch0022: 0001-fix-display-Fix-multi-screen-auto-display-while-swit.patch Patch0023: 0001-fix-systeminfo-Fix-to-get-pci-info-for-multiple-devi.patch Patch0024: 0001-fix-plugin-remove-active-or-deactive-mate-plugin-cod.patch Patch0025: 0001-fix-display-fix-the-switch-function-invalidation-pro.patch +Patch0026: 0001-fix-appearance-set-dark-theme-when-hour-greater-than.patch BuildRequires: cmake >= 3.2 BuildRequires: pkgconfig(glibmm-2.4) @@ -215,6 +216,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || : %{_libdir}/pkgconfig/kiran-cc-daemon.pc %changelog +* Wed Nov 29 2023 yuanxing - 2.5.1-31 +- KYOS-F: set dark theme when hour greater than or equal to 20 at night.(#20784) + * Sun Oct 8 2023 tangjie02 - 2.5.1-30 - KYOS-B: fix the switch function invalidation problem after turn off monitor, then logout and relogin session.(#17149) -- Gitee