diff options
author | 2022-06-21 01:13:52 +0100 | |
---|---|---|
committer | 2022-06-21 01:13:52 +0100 | |
commit | 6fec8365f601d71f4d8e0863683f34cbe8dd111e (patch) | |
tree | eecb873ee26a351b828468960805d308c9818940 /src | |
parent | Fix images with query strings (#318) (diff) | |
download | ferdium-app-6fec8365f601d71f4d8e0863683f34cbe8dd111e.tar.gz ferdium-app-6fec8365f601d71f4d8e0863683f34cbe8dd111e.tar.zst ferdium-app-6fec8365f601d71f4d8e0863683f34cbe8dd111e.zip |
Feature: Add Toggle Navbar to View Menu (global) (#317)
Add Toggle Navbar to View Menu (global)
Diffstat (limited to 'src')
-rw-r--r-- | src/components/services/content/ServiceView.js | 5 | ||||
-rw-r--r-- | src/config.ts | 1 | ||||
-rw-r--r-- | src/lib/Menu.js | 19 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js index 5ff059f52..504325c3a 100644 --- a/src/components/services/content/ServiceView.js +++ b/src/components/services/content/ServiceView.js | |||
@@ -77,12 +77,13 @@ class ServiceView extends Component { | |||
77 | isSpellcheckerEnabled, | 77 | isSpellcheckerEnabled, |
78 | } = this.props; | 78 | } = this.props; |
79 | 79 | ||
80 | const { navigationBarBehaviour } = stores.settings.app; | 80 | const { navigationBarBehaviour, navigationBarManualActive } = stores.settings.app; |
81 | 81 | ||
82 | const showNavBar = | 82 | const showNavBar = |
83 | navigationBarBehaviour === 'always' || | 83 | navigationBarBehaviour === 'always' || |
84 | (navigationBarBehaviour === 'custom' && | 84 | (navigationBarBehaviour === 'custom' && |
85 | service.recipe.id === CUSTOM_WEBSITE_RECIPE_ID); | 85 | service.recipe.id === CUSTOM_WEBSITE_RECIPE_ID) || |
86 | navigationBarManualActive; | ||
86 | 87 | ||
87 | const webviewClasses = classnames({ | 88 | const webviewClasses = classnames({ |
88 | services__webview: true, | 89 | services__webview: true, |
diff --git a/src/config.ts b/src/config.ts index 8b61b5698..e8ffb83f8 100644 --- a/src/config.ts +++ b/src/config.ts | |||
@@ -222,6 +222,7 @@ export const DEFAULT_APP_SETTINGS = { | |||
222 | enableSpellchecking: true, | 222 | enableSpellchecking: true, |
223 | spellcheckerLanguage: 'en-us', | 223 | spellcheckerLanguage: 'en-us', |
224 | darkMode: false, | 224 | darkMode: false, |
225 | navigationBarManualActive: false, | ||
225 | splitMode: false, | 226 | splitMode: false, |
226 | splitColumns: 3, | 227 | splitColumns: 3, |
227 | fallbackLocale: 'en-US', | 228 | fallbackLocale: 'en-US', |
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 50145dd47..98de80884 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -124,6 +124,10 @@ const menuItems = defineMessages({ | |||
124 | id: 'menu.view.toggleFullScreen', | 124 | id: 'menu.view.toggleFullScreen', |
125 | defaultMessage: 'Toggle Full Screen', | 125 | defaultMessage: 'Toggle Full Screen', |
126 | }, | 126 | }, |
127 | toggleNavigationBar: { | ||
128 | id: 'menu.view.toggleNavigationBar', | ||
129 | defaultMessage: 'Toggle Navigation Bar', | ||
130 | }, | ||
127 | toggleDarkMode: { | 131 | toggleDarkMode: { |
128 | id: 'menu.view.toggleDarkMode', | 132 | id: 'menu.view.toggleDarkMode', |
129 | defaultMessage: 'Toggle Dark Mode', | 133 | defaultMessage: 'Toggle Dark Mode', |
@@ -460,6 +464,21 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
460 | role: 'toggleFullScreen', | 464 | role: 'toggleFullScreen', |
461 | }, | 465 | }, |
462 | { | 466 | { |
467 | label: intl.formatMessage(menuItems.toggleNavigationBar), | ||
468 | accelerator: `${cmdOrCtrlShortcutKey()}+B`, | ||
469 | role: 'toggleNavigationBar', | ||
470 | type: 'checkbox', | ||
471 | checked: window['ferdium'].stores.settings.app.navigationBarManualActive, | ||
472 | click: () => { | ||
473 | window['ferdium'].actions.settings.update({ | ||
474 | type: 'app', | ||
475 | data: { | ||
476 | navigationBarManualActive: !window['ferdium'].stores.settings.app.navigationBarManualActive, | ||
477 | } | ||
478 | }); | ||
479 | } | ||
480 | }, | ||
481 | { | ||
463 | label: intl.formatMessage(menuItems.toggleDarkMode), | 482 | label: intl.formatMessage(menuItems.toggleDarkMode), |
464 | type: 'checkbox', | 483 | type: 'checkbox', |
465 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+D`, | 484 | accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+D`, |