Add tab-switching shortcuts to new tab bar

Closes #541
This commit is contained in:
Shadowfacts 2024-09-09 19:18:12 -04:00
parent 3f4917931b
commit f9c0506590
1 changed files with 27 additions and 4 deletions

View File

@ -314,10 +314,6 @@ final class NewMainTabBarViewController: BaseMainTabBarViewController {
} }
} }
@objc func handleComposeKeyCommand() {
compose(editing: nil)
}
@objc private func sidebarTapped() { @objc private func sidebarTapped() {
#if !os(visionOS) #if !os(visionOS)
fastAccountSwitcher?.hide() fastAccountSwitcher?.hide()
@ -408,6 +404,33 @@ final class NewMainTabBarViewController: BaseMainTabBarViewController {
return true return true
} }
#endif #endif
// MARK: Keyboard shortcuts
@objc func handleSidebarCommandTimelines() {
selectedTab = homeTab
}
@objc func handleSidebarCommandNotifications() {
selectedTab = notificationsTab
}
@objc func handleSidebarCommandExplore() {
selectedTab = exploreTab
}
@objc func handleSidebarCommandBookmarks() {
selectedTab = bookmarksTab
}
@objc func handleSidebarCommandMyProfile() {
selectedTab = myProfileTab
}
@objc func handleComposeKeyCommand() {
compose(editing: nil)
}
} }
@available(iOS 18.0, *) @available(iOS 18.0, *)