From 7524121a2b0b91752691bdb20d734cbae5c6b651 Mon Sep 17 00:00:00 2001 From: SimplestStudio Date: Wed, 28 May 2025 14:39:01 +0300 Subject: [PATCH 1/5] [win-linux] add night theme --- win-linux/res/styles/theme-night.json | 66 +++++++++++++++++++++++++++ win-linux/resources.qrc | 1 + win-linux/src/cthemes.cpp | 1 + 3 files changed, 68 insertions(+) create mode 100644 win-linux/res/styles/theme-night.json diff --git a/win-linux/res/styles/theme-night.json b/win-linux/res/styles/theme-night.json new file mode 100644 index 000000000..d33647d85 --- /dev/null +++ b/win-linux/res/styles/theme-night.json @@ -0,0 +1,66 @@ +{ + "id": "theme-night", + "type": "dark", + "values": { + "brand-word": "#2a2a2a", + "brand-slide": "#2a2a2a", + "brand-cell": "#2a2a2a", + "brand-pdf": "#2a2a2a", + "brand-draw": "#2a2a2a", + + "window-background": "#404040", + "window-border": "#616161", + + "text-normal": "#d9d9d9", + "text-pretty": "#d9d9d9", + "text-inverse": "#444", + + "tool-button-background": "#404040", + "tool-button-hover-background": "#555", + "tool-button-pressed-background": "#606060", + "tool-button-active-background": "#333", + + "download-widget-background": "#333", + "download-widget-border": "#666666", + "download-item-hover-background": "#555", + + "download-ghost-button-text": "#96c8fd", + "download-ghost-button-text-hover": "#d6d6d6", + "download-ghost-button-text-pressed": "#858585", + "download-ghost-button-text-pressed-item-hover": "#999999", + + "download-label-text": "#d6d6d6", + "download-label-text-info": "#858585", + "download-label-text-info-item-hover": "#999999", + + "download-progressbar-chunk": "#96c8fd", + "download-progressbar-background": "#858585", + "download-progressbar-background-item-hover": "#999999", + + "download-scrollbar-handle": "#999999", + + "menu-background": "#333", + "menu-border": "#666666", + "menu-item-hover-background": "#555", + + "menu-text": "#d6d6d6", + "menu-text-item-hover": "#ddd", + "menu-text-item-disabled": "#757575", + + "menu-separator": "#505050", + + "tooltip-text": "#d2d2d2", + "tooltip-border": "#666666", + "tooltip-background": "#333", + + "tab-active-background": "#333", + "tab-simple-active-background": "#333", + "tab-simple-active-text": "#fff", + "tab-default-active-background": "#333", + "tab-default-active-text": "#fff", + "tab-divider": "#505050", + + "button-normal-opacity": "rgba(255,255,255,200)", + "logo-type": "light" + } +} diff --git a/win-linux/resources.qrc b/win-linux/resources.qrc index b84b17447..5622a1118 100644 --- a/win-linux/resources.qrc +++ b/win-linux/resources.qrc @@ -243,5 +243,6 @@ res/styles/theme-contrast-dark.json res/styles/theme-gray.json res/styles/theme-white.json + res/styles/theme-night.json diff --git a/win-linux/src/cthemes.cpp b/win-linux/src/cthemes.cpp index e3076e46e..e10d0a74e 100644 --- a/win-linux/src/cthemes.cpp +++ b/win-linux/src/cthemes.cpp @@ -242,6 +242,7 @@ public: {"theme-contrast-dark", ":/themes/theme-contrast-dark.json"}, {"theme-gray", ":/themes/theme-gray.json"}, {"theme-white", ":/themes/theme-white.json"}, + {"theme-night", ":/themes/theme-night.json"}, }; GET_REGISTRY_USER(_reg_user); From 698d2ae3997c3288cfafcfbae86a87e3cab3b415 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 29 May 2025 17:13:03 +0300 Subject: [PATCH 2/5] [home] added one more 'dark' theme --- common/loginpage/src/panelsettings.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/loginpage/src/panelsettings.js b/common/loginpage/src/panelsettings.js index 925c861ec..8fe06e388 100644 --- a/common/loginpage/src/panelsettings.js +++ b/common/loginpage/src/panelsettings.js @@ -40,8 +40,8 @@ const THEME_TYPE_DARK = 'dark'; const THEME_TYPE_SYSTEM = 'system'; - const THEME_ID_DEFAULT_LIGHT = 'theme-classic-light'; - const THEME_ID_DEFAULT_DARK = 'theme-dark'; + const THEME_ID_DEFAULT_LIGHT = 'theme-white'; + const THEME_ID_DEFAULT_DARK = 'theme-night'; const themes_map = { 'theme-system': { @@ -72,6 +72,10 @@ text: 'White'/*utils.Lang.settOptThemeGray*/, type: 'light', }, + 'theme-night': { + text: 'Night'/*utils.Lang.settOptThemeGray*/, + type: 'dark', + }, } const nativevars = window.RendererProcessVariable; From 018d25d71a01ee7cf89c184f7776e7a8df5ce79c Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 29 May 2025 17:14:43 +0300 Subject: [PATCH 3/5] [win-nix] changed default 'dark' theme --- win-linux/src/cthemes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win-linux/src/cthemes.cpp b/win-linux/src/cthemes.cpp index e10d0a74e..05b59c1b1 100644 --- a/win-linux/src/cthemes.cpp +++ b/win-linux/src/cthemes.cpp @@ -21,7 +21,7 @@ #define QSTRING_FROM_WSTR(s) QString::fromStdWString(s) #define REGISTRY_THEME_KEY "UITheme" #define REGISTRY_THEME_KEY_7_2 "UITheme2" -#define THEME_DEFAULT_DARK_ID "theme-dark" +#define THEME_DEFAULT_DARK_ID "theme-night" #define THEME_DEFAULT_LIGHT_ID "theme-white" #define THEME_ID_SYSTEM "theme-system" From 957d301096d2a8b5e6ea7155850bce6bf92a514b Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 29 May 2025 17:24:57 +0300 Subject: [PATCH 4/5] [home] added theme source --- common/loginpage/src/css/colors_night.less | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 common/loginpage/src/css/colors_night.less diff --git a/common/loginpage/src/css/colors_night.less b/common/loginpage/src/css/colors_night.less new file mode 100644 index 000000000..eefe10f4e --- /dev/null +++ b/common/loginpage/src/css/colors_night.less @@ -0,0 +1,43 @@ + +:root { + .theme-night { + --background-normal: #333; + --background-tabbar: #404040; + --background-button: #333; + --background-primary-button: #ddd; + --background-accent-button: #3483db; + --background-scrim: fade(#000, 60%); + --background-scroll-thumb: #555; + + --highlight-button-hover: #555; + --highlight-button-pressed: #606060; + --highlight-button-pressed-hover: #808080; + --highlight-accent-button-hover: #5293e2; + --highlight-accent-button-pressed: #3475c5; + --highlight-primary-button-hover: #e5e5e5; + --highlight-primary-button-pressed: #e5e5e5; + --highlight-header-button-hover: fade(#000, 20%); + --highlight-text-select: #96c8fd; + --highlight-scroll-thumb-hover: #606060; + --highlight-scroll-track-hover: fade(#fff, 3%); + + --border-tabbar: #2a2a2a; + --border-divider: #505050; + --border-regular-control: #666666; + --border-control-focus: #ccc; + --border-error: #f62211; + + --text-normal: fade(#fff, 80%); + --text-normal-pressed: fade(#fff, 80%); + --text-secondary: fade(#fff, 60%); + --text-tertiary: fade(#fff, 40%); + --text-link: #acbfff; + --text-inverse: #333; + --text-contrast-background: #fff; + + --icon-normal: fade(#fff, 80%); + + --disabled-element-opacity: .3; + --theme-inverted-image-filter: invert(1); + } +} From 20162a67a97d700c9fe893d17d50abd8c7786d64 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 29 May 2025 17:27:49 +0300 Subject: [PATCH 5/5] [home] fix theme changing --- common/loginpage/src/panelsettings.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/loginpage/src/panelsettings.js b/common/loginpage/src/panelsettings.js index 8fe06e388..4045fac94 100644 --- a/common/loginpage/src/panelsettings.js +++ b/common/loginpage/src/panelsettings.js @@ -334,6 +334,9 @@ const theme_id = uitheme.relevant_theme_id(); if ( !$("body").hasClass(theme_id) ) { + if ( !type && themes_map[id] ) + type = themes_map[id].type; + const _type = (type == 'dark' || /theme-(?:[a-z]+-)?dark(?:-[a-z]*)?/.test(theme_id)) ? 'theme-type-dark' : 'theme-type-light'; const _cls = document.body.className.replace(/theme-[\w-]+/gi,'').trim(); document.body.className = `${_cls?_cls+' ':''}${theme_id} ${_type}`;