Change focus when the sidebar is shown or hidden. Issue #1004

This commit is contained in:
Maurice Parker
2020-03-14 14:36:18 -05:00
parent 229aada857
commit 118ce73c08
2 changed files with 9 additions and 3 deletions

View File

@@ -226,7 +226,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
return validateToggleReadArticles(item)
}
if item.action == #selector(toggleSidebar(_:)) {
if item.action == #selector(toggleTheSidebar(_:)) {
guard let splitViewItem = sidebarSplitViewItem else {
return false
}
@@ -360,8 +360,14 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
nextUnread(sender)
}
@IBAction func toggleSidebar(_ sender: Any?) {
@IBAction func toggleTheSidebar(_ sender: Any?) {
splitViewController!.toggleSidebar(sender)
guard let splitViewItem = sidebarSplitViewItem else { return }
if splitViewItem.isCollapsed {
currentTimelineViewController?.focus()
} else {
sidebarViewController?.focus()
}
}
@IBAction func markAboveArticlesAsRead(_ sender: Any?) {