aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-15 18:39:01 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-17 14:44:50 +0200
commit3a353cc460cd24f296cdad150b805020c7c036bd (patch)
tree6b44dc0a500b721091ab70986a6d8f1638ed2eb3
parentfeat(renderer): use system fonts (diff)
downloadsophie-3a353cc460cd24f296cdad150b805020c7c036bd.tar.gz
sophie-3a353cc460cd24f296cdad150b805020c7c036bd.tar.zst
sophie-3a353cc460cd24f296cdad150b805020c7c036bd.zip
fix(main): show location bar menu item enable
Synchronize enabledness of the menu item with the toggle location bar button in the sidebar. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
-rw-r--r--packages/main/src/infrastructure/electron/impl/setApplicationMenu.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/main/src/infrastructure/electron/impl/setApplicationMenu.ts b/packages/main/src/infrastructure/electron/impl/setApplicationMenu.ts
index 8e10383..32b2d4d 100644
--- a/packages/main/src/infrastructure/electron/impl/setApplicationMenu.ts
+++ b/packages/main/src/infrastructure/electron/impl/setApplicationMenu.ts
@@ -37,8 +37,13 @@ export default function setApplicationMenu(
37 const { t } = translation; 37 const { t } = translation;
38 38
39 const { settings, shared, visibleService } = store; 39 const { settings, shared, visibleService } = store;
40 const { showLocationBar, selectedService } = settings; 40 const { selectedService } = settings;
41 const { canSwitchServices, services } = shared; 41 const {
42 canSwitchServices,
43 canToggleLocationBar,
44 locationBarVisible,
45 services,
46 } = shared;
42 47
43 const template: MenuItemConstructorOptions[] = [ 48 const template: MenuItemConstructorOptions[] = [
44 ...(isMac ? ([{ role: 'appMenu' }] as MenuItemConstructorOptions[]) : []), 49 ...(isMac ? ([{ role: 'appMenu' }] as MenuItemConstructorOptions[]) : []),
@@ -51,7 +56,8 @@ export default function setApplicationMenu(
51 label: t<string>('menu.view.showLocationBar'), 56 label: t<string>('menu.view.showLocationBar'),
52 accelerator: 'CommandOrControl+Shift+L', 57 accelerator: 'CommandOrControl+Shift+L',
53 type: 'checkbox', 58 type: 'checkbox',
54 checked: showLocationBar, 59 checked: locationBarVisible,
60 enabled: canToggleLocationBar,
55 click() { 61 click() {
56 settings.toggleLocationBar(); 62 settings.toggleLocationBar();
57 }, 63 },