toggling between views made possible
This commit is contained in:
@@ -71,6 +71,18 @@ extension WorkspaceModel {
|
||||
|
||||
// MARK: Git view
|
||||
|
||||
/// ⌘G or ⌘D: toggles the view, but over the search or the Diff it switches to it.
|
||||
/// Both full-screen views sit under `OverlayHost`, so a toggle beneath them would stay hidden.
|
||||
func toggleView(isOpen: Bool, open: () -> Void, close: () -> Void) {
|
||||
switch overlay.current {
|
||||
case .search, .diff:
|
||||
overlay.dismiss()
|
||||
open()
|
||||
default:
|
||||
isOpen ? close() : open()
|
||||
}
|
||||
}
|
||||
|
||||
/// Opens the Git view on its message field, re-reads git and fetches origin; an open view only takes the field again.
|
||||
func openGitView() {
|
||||
if !layout.isGitViewOpen {
|
||||
|
||||
Reference in New Issue
Block a user