aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/UIStore.js
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-09-23 00:27:09 +0200
committerLibravatar GitHub <noreply@github.com>2020-09-22 23:27:09 +0100
commit04116a087b84dd84f4461f74f079833c57dfa479 (patch)
tree63e47294856b65bedf5ca6ed92a3b0f3b386d323 /src/stores/UIStore.js
parentUpgrading to Electron 9 (#809) (diff)
downloadferdium-app-04116a087b84dd84f4461f74f079833c57dfa479.tar.gz
ferdium-app-04116a087b84dd84f4461f74f079833c57dfa479.tar.zst
ferdium-app-04116a087b84dd84f4461f74f079833c57dfa479.zip
Update adaptable dark mode to work on all platforms (#834)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'src/stores/UIStore.js')
-rw-r--r--src/stores/UIStore.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js
index f6e059bfb..ba2cffb73 100644
--- a/src/stores/UIStore.js
+++ b/src/stores/UIStore.js
@@ -12,9 +12,7 @@ const { nativeTheme, systemPreferences } = remote;
12export default class UIStore extends Store { 12export default class UIStore extends Store {
13 @observable showServicesUpdatedInfoBar = false; 13 @observable showServicesUpdatedInfoBar = false;
14 14
15 @observable isOsDarkThemeActive = (isMac || isWindows) 15 @observable isOsDarkThemeActive = nativeTheme.shouldUseDarkColors;
16 ? nativeTheme.shouldUseDarkColors
17 : false;
18 16
19 constructor(...args) { 17 constructor(...args) {
20 super(...args); 18 super(...args);
@@ -63,16 +61,14 @@ export default class UIStore extends Store {
63 } 61 }
64 62
65 @computed get isDarkThemeActive() { 63 @computed get isDarkThemeActive() {
66 const isMacOrWindowsWithAdaptableInDarkMode = (isMac || isWindows) 64 const isWithAdaptableInDarkMode = this.stores.settings.all.app.adaptableDarkMode
67 && this.stores.settings.all.app.adaptableDarkMode
68 && this.isOsDarkThemeActive; 65 && this.isOsDarkThemeActive;
69 const isMacOrWindowsWithoutAdaptableInDarkMode = (isMac || isWindows) 66 const isWithoutAdaptableInDarkMode = this.stores.settings.all.app.darkMode
70 && this.stores.settings.all.app.darkMode
71 && !this.stores.settings.all.app.adaptableDarkMode; 67 && !this.stores.settings.all.app.adaptableDarkMode;
72 const isMacOrWindowsNotInDarkMode = !(isMac || isWindows) && this.stores.settings.all.app.darkMode; 68 const isInDarkMode = this.stores.settings.all.app.darkMode;
73 return !!(isMacOrWindowsWithAdaptableInDarkMode 69 return !!(isWithAdaptableInDarkMode
74 || isMacOrWindowsWithoutAdaptableInDarkMode 70 || isWithoutAdaptableInDarkMode
75 || isMacOrWindowsNotInDarkMode); 71 || isInDarkMode);
76 } 72 }
77 73
78 @computed get theme() { 74 @computed get theme() {