fix: use cmd+. to toggle sidebar on macOS (#4621)

* fix: use cmd+. to hide sidebar on macOS

* fix: update missed tooltip
This commit is contained in:
Mathias Mogensen
2024-02-07 05:18:13 +01:00
committed by GitHub
parent db5372c18e
commit 3129fa6cc1
3 changed files with 3 additions and 4 deletions

View File

@ -43,7 +43,7 @@ class HomeHotKeys extends StatelessWidget {
// Collapse sidebar menu
HotKeyItem(
hotKey: HotKey(
KeyCode.backslash,
Platform.isMacOS ? KeyCode.period : KeyCode.backslash,
modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control],
// Set hotkey scope (default is HotKeyScope.system)
scope: HotKeyScope.inapp, // Set as inapp-wide hotkey.

View File

@ -65,8 +65,7 @@ class SidebarTopMenu extends StatelessWidget {
text: '${LocaleKeys.sideBar_closeSidebar.tr()}\n',
),
TextSpan(
// TODO(Lucas.Xu): it doesn't work on macOS.
text: Platform.isMacOS ? '⌘+\\' : 'Ctrl+\\',
text: Platform.isMacOS ? '⌘+.' : 'Ctrl+\\',
),
],
);

View File

@ -184,7 +184,7 @@ TextSpan sidebarTooltipTextSpan(BuildContext context, String hintText) =>
text: "$hintText\n",
),
TextSpan(
text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\",
text: Platform.isMacOS ? "⌘+." : "Ctrl+\\",
),
],
);