diff options
author | 2020-01-31 16:54:14 +0100 | |
---|---|---|
committer | 2020-01-31 16:54:14 +0100 | |
commit | eefda6c7b3e9f0e9b0cfc056efbf59d04a54be85 (patch) | |
tree | 0cc58679ac60afcd2b5f620ce88088644e677bb9 | |
parent | Add better sync between Ferdi and service dark mode (diff) | |
download | ferdium-app-eefda6c7b3e9f0e9b0cfc056efbf59d04a54be85.tar.gz ferdium-app-eefda6c7b3e9f0e9b0cfc056efbf59d04a54be85.tar.zst ferdium-app-eefda6c7b3e9f0e9b0cfc056efbf59d04a54be85.zip |
Improve dark mode behaviour on macOS
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 8 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 3 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 4 | ||||
-rw-r--r-- | src/i18n/messages/src/containers/settings/EditSettingsScreen.json | 2 | ||||
-rw-r--r-- | src/stores/UIStore.js | 1 |
5 files changed, 10 insertions, 8 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 9064ff234..61c31ac93 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -170,6 +170,7 @@ export default @observer class EditSettingsForm extends Component { | |||
170 | noUpdates: PropTypes.bool.isRequired, | 170 | noUpdates: PropTypes.bool.isRequired, |
171 | hibernationEnabled: PropTypes.bool.isRequired, | 171 | hibernationEnabled: PropTypes.bool.isRequired, |
172 | isDarkmodeEnabled: PropTypes.bool.isRequired, | 172 | isDarkmodeEnabled: PropTypes.bool.isRequired, |
173 | isAdaptableDarkModeEnabled: PropTypes.bool.isRequired, | ||
173 | openProcessManager: PropTypes.func.isRequired, | 174 | openProcessManager: PropTypes.func.isRequired, |
174 | }; | 175 | }; |
175 | 176 | ||
@@ -194,6 +195,7 @@ export default @observer class EditSettingsForm extends Component { | |||
194 | installUpdate, | 195 | installUpdate, |
195 | form, | 196 | form, |
196 | isCheckingForUpdates, | 197 | isCheckingForUpdates, |
198 | isAdaptableDarkModeEnabled, | ||
197 | isUpdateAvailable, | 199 | isUpdateAvailable, |
198 | noUpdateAvailable, | 200 | noUpdateAvailable, |
199 | updateIsReadyToInstall, | 201 | updateIsReadyToInstall, |
@@ -429,10 +431,10 @@ export default @observer class EditSettingsForm extends Component { | |||
429 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> | 431 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> |
430 | <Toggle field={form.$('showDisabledServices')} /> | 432 | <Toggle field={form.$('showDisabledServices')} /> |
431 | <Toggle field={form.$('showMessageBadgeWhenMuted')} /> | 433 | <Toggle field={form.$('showMessageBadgeWhenMuted')} /> |
432 | <Toggle field={form.$('darkMode')} /> | 434 | {isMac && <Toggle field={form.$('adaptableDarkMode')} />} |
433 | {isDarkmodeEnabled && ( | 435 | {!(isMac && isAdaptableDarkModeEnabled) && <Toggle field={form.$('darkMode')} disabled={isAdaptableDarkModeEnabled} />} |
436 | {(isDarkmodeEnabled || isAdaptableDarkModeEnabled) && ( | ||
434 | <> | 437 | <> |
435 | {isMac && <Toggle field={form.$('adaptableDarkMode')} />} | ||
436 | <Toggle field={form.$('universalDarkMode')} /> | 438 | <Toggle field={form.$('universalDarkMode')} /> |
437 | <p | 439 | <p |
438 | className="settings__message" | 440 | className="settings__message" |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index c92ad4df0..a7c2b428f 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -104,7 +104,7 @@ const messages = defineMessages({ | |||
104 | }, | 104 | }, |
105 | adaptableDarkMode: { | 105 | adaptableDarkMode: { |
106 | id: 'settings.app.form.adaptableDarkMode', | 106 | id: 'settings.app.form.adaptableDarkMode', |
107 | defaultMessage: '!!!Enable adaptable Dark Mode', | 107 | defaultMessage: '!!!Synchronize dark mode with my Mac\'s dark mode setting', |
108 | }, | 108 | }, |
109 | universalDarkMode: { | 109 | universalDarkMode: { |
110 | id: 'settings.app.form.universalDarkMode', | 110 | id: 'settings.app.form.universalDarkMode', |
@@ -466,6 +466,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
466 | noUpdates={this.props.stores.settings.app.noUpdates} | 466 | noUpdates={this.props.stores.settings.app.noUpdates} |
467 | hibernationEnabled={this.props.stores.settings.app.hibernate} | 467 | hibernationEnabled={this.props.stores.settings.app.hibernate} |
468 | isDarkmodeEnabled={this.props.stores.settings.app.darkMode} | 468 | isDarkmodeEnabled={this.props.stores.settings.app.darkMode} |
469 | isAdaptableDarkModeEnabled={this.props.stores.settings.app.adaptableDarkMode} | ||
469 | openProcessManager={() => this.openProcessManager()} | 470 | openProcessManager={() => this.openProcessManager()} |
470 | /> | 471 | /> |
471 | </ErrorBoundary> | 472 | </ErrorBoundary> |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 510a29143..f1acf9904 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -257,11 +257,11 @@ | |||
257 | "settings.app.cacheInfo": "Ferdi cache is currently using {size} of disk space.", | 257 | "settings.app.cacheInfo": "Ferdi cache is currently using {size} of disk space.", |
258 | "settings.app.currentVersion": "Current version:", | 258 | "settings.app.currentVersion": "Current version:", |
259 | "settings.app.form.accentColor": "Accent color", | 259 | "settings.app.form.accentColor": "Accent color", |
260 | "settings.app.form.adaptableDarkMode": "Enable adaptable Dark Mode", | 260 | "settings.app.form.adaptableDarkMode": "Synchronize dark mode with my Mac's dark mode setting", |
261 | "settings.app.form.autoLaunchInBackground": "Open in background", | 261 | "settings.app.form.autoLaunchInBackground": "Open in background", |
262 | "settings.app.form.autoLaunchOnStart": "Launch Ferdi on start", | 262 | "settings.app.form.autoLaunchOnStart": "Launch Ferdi on start", |
263 | "settings.app.form.beta": "Include beta versions", | 263 | "settings.app.form.beta": "Include beta versions", |
264 | "settings.app.form.darkMode": "Join the Dark Side", | 264 | "settings.app.form.darkMode": "Enable dark mode", |
265 | "settings.app.form.enableGPUAcceleration": "Enable GPU Acceleration", | 265 | "settings.app.form.enableGPUAcceleration": "Enable GPU Acceleration", |
266 | "settings.app.form.enableLock": "Enable Password Lock", | 266 | "settings.app.form.enableLock": "Enable Password Lock", |
267 | "settings.app.form.enableSpellchecking": "Enable spell checking", | 267 | "settings.app.form.enableSpellchecking": "Enable spell checking", |
diff --git a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json index 06874d97e..82a9a7cd5 100644 --- a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json +++ b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json | |||
@@ -248,7 +248,7 @@ | |||
248 | }, | 248 | }, |
249 | { | 249 | { |
250 | "id": "settings.app.form.adaptableDarkMode", | 250 | "id": "settings.app.form.adaptableDarkMode", |
251 | "defaultMessage": "!!!Enable adaptable Dark Mode", | 251 | "defaultMessage": "!!!Synchronize dark mode with my Mac's dark mode setting", |
252 | "file": "src/containers/settings/EditSettingsScreen.js", | 252 | "file": "src/containers/settings/EditSettingsScreen.js", |
253 | "start": { | 253 | "start": { |
254 | "line": 105, | 254 | "line": 105, |
diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index 5b9672798..6941cf086 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js | |||
@@ -57,7 +57,6 @@ export default class UIStore extends Store { | |||
57 | 57 | ||
58 | @computed get isDarkThemeActive() { | 58 | @computed get isDarkThemeActive() { |
59 | const isMacWithAdaptableInDarkMode = isMac | 59 | const isMacWithAdaptableInDarkMode = isMac |
60 | && this.stores.settings.all.app.darkMode | ||
61 | && this.stores.settings.all.app.adaptableDarkMode | 60 | && this.stores.settings.all.app.adaptableDarkMode |
62 | && this.isOsDarkThemeActive; | 61 | && this.isOsDarkThemeActive; |
63 | const isMacWithoutAdaptableInDarkMode = isMac | 62 | const isMacWithoutAdaptableInDarkMode = isMac |