From 3129fa6cc19df894e344d19b93e1cdf00f1a8c1a Mon Sep 17 00:00:00 2001 From: Mathias Mogensen <42929161+Xazin@users.noreply.github.com> Date: Wed, 7 Feb 2024 05:18:13 +0100 Subject: [PATCH] fix: use cmd+. to toggle sidebar on macOS (#4621) * fix: use cmd+. to hide sidebar on macOS * fix: update missed tooltip --- .../lib/workspace/presentation/home/hotkeys.dart | 2 +- .../presentation/home/menu/sidebar/sidebar_top_menu.dart | 3 +-- .../lib/workspace/presentation/home/navigation.dart | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart index 2e1dfc2b5a..e49c2786b3 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart @@ -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. diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart index ef044b06d7..1c7452584a 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart @@ -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+\\', ), ], ); diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart index d0c595b5bb..8d5a0259ee 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart @@ -184,7 +184,7 @@ TextSpan sidebarTooltipTextSpan(BuildContext context, String hintText) => text: "$hintText\n", ), TextSpan( - text: Platform.isMacOS ? "⌘+\\" : "Ctrl+\\", + text: Platform.isMacOS ? "⌘+." : "Ctrl+\\", ), ], );