Change focus when the sidebar is shown or hidden. Issue #1004
This commit is contained in:
parent
229aada857
commit
118ce73c08
|
@ -384,7 +384,7 @@
|
||||||
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
|
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
|
||||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="toggleSidebar:" target="Ady-hI-5gd" id="dOo-rp-1f6"/>
|
<action selector="toggleTheSidebar:" target="Ady-hI-5gd" id="1hl-EZ-ao4"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem isSeparatorItem="YES" id="jKG-b2-ZWf"/>
|
<menuItem isSeparatorItem="YES" id="jKG-b2-ZWf"/>
|
||||||
|
|
|
@ -226,7 +226,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
||||||
return validateToggleReadArticles(item)
|
return validateToggleReadArticles(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if item.action == #selector(toggleSidebar(_:)) {
|
if item.action == #selector(toggleTheSidebar(_:)) {
|
||||||
guard let splitViewItem = sidebarSplitViewItem else {
|
guard let splitViewItem = sidebarSplitViewItem else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -360,8 +360,14 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
||||||
nextUnread(sender)
|
nextUnread(sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func toggleSidebar(_ sender: Any?) {
|
@IBAction func toggleTheSidebar(_ sender: Any?) {
|
||||||
splitViewController!.toggleSidebar(sender)
|
splitViewController!.toggleSidebar(sender)
|
||||||
|
guard let splitViewItem = sidebarSplitViewItem else { return }
|
||||||
|
if splitViewItem.isCollapsed {
|
||||||
|
currentTimelineViewController?.focus()
|
||||||
|
} else {
|
||||||
|
sidebarViewController?.focus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func markAboveArticlesAsRead(_ sender: Any?) {
|
@IBAction func markAboveArticlesAsRead(_ sender: Any?) {
|
||||||
|
|
Loading…
Reference in New Issue