mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Save and toggle full screen state. Issue #2053
This commit is contained in:
@@ -739,6 +739,7 @@ private extension MainWindowController {
|
||||
|
||||
func savableState() -> [AnyHashable : Any] {
|
||||
var state = [AnyHashable : Any]()
|
||||
state[UserInfoKey.windowFullScreenState] = window?.styleMask.contains(.fullScreen) ?? false
|
||||
saveSplitViewState(to: &state)
|
||||
sidebarViewController?.saveState(to: &state)
|
||||
timelineContainerViewController?.saveState(to: &state)
|
||||
@@ -746,6 +747,9 @@ private extension MainWindowController {
|
||||
}
|
||||
|
||||
func restoreState(from state: [AnyHashable : Any]) {
|
||||
if let fullScreen = state[UserInfoKey.windowFullScreenState] as? Bool, fullScreen {
|
||||
window?.toggleFullScreen(self)
|
||||
}
|
||||
restoreSplitViewState(from: state)
|
||||
sidebarViewController?.restoreState(from: state)
|
||||
timelineContainerViewController?.restoreState(from: state)
|
||||
|
||||
Reference in New Issue
Block a user