Add command palette minimal mode actions
This commit is contained in:
parent
b4b345d4ad
commit
637a0eed13
2 changed files with 60 additions and 0 deletions
|
|
@ -14349,6 +14349,40 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"command.enableMinimalMode.title": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"en": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "Enable Minimal Mode"
|
||||
}
|
||||
},
|
||||
"ja": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "ミニマルモードを有効にする"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"command.disableMinimalMode.title": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"en": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "Disable Minimal Mode"
|
||||
}
|
||||
},
|
||||
"ja": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "ミニマルモードを無効にする"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"command.installCLI.subtitle": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
|
|
|
|||
|
|
@ -1609,6 +1609,7 @@ struct ContentView: View {
|
|||
static let hasWorkspace = "workspace.hasSelection"
|
||||
static let workspaceName = "workspace.name"
|
||||
static let workspaceHasCustomName = "workspace.hasCustomName"
|
||||
static let workspaceMinimalModeEnabled = "workspace.minimalModeEnabled"
|
||||
static let workspaceShouldPin = "workspace.shouldPin"
|
||||
static let workspaceHasPullRequests = "workspace.hasPullRequests"
|
||||
static let workspaceHasSplits = "workspace.hasSplits"
|
||||
|
|
@ -4888,6 +4889,7 @@ struct ContentView: View {
|
|||
terminalOpenTargets: Set<TerminalDirectoryOpenTarget>? = nil
|
||||
) -> CommandPaletteContextSnapshot {
|
||||
var snapshot = CommandPaletteContextSnapshot()
|
||||
snapshot.setBool(CommandPaletteContextKeys.workspaceMinimalModeEnabled, isMinimalMode)
|
||||
|
||||
if let workspace = tabManager.selectedWorkspace {
|
||||
snapshot.setBool(CommandPaletteContextKeys.hasWorkspace, true)
|
||||
|
|
@ -5092,6 +5094,24 @@ struct ContentView: View {
|
|||
keywords: ["toggle", "sidebar", "layout"]
|
||||
)
|
||||
)
|
||||
contributions.append(
|
||||
CommandPaletteCommandContribution(
|
||||
commandId: "palette.enableMinimalMode",
|
||||
title: constant(String(localized: "command.enableMinimalMode.title", defaultValue: "Enable Minimal Mode")),
|
||||
subtitle: constant(String(localized: "command.toggleSidebar.subtitle", defaultValue: "Layout")),
|
||||
keywords: ["minimal", "mode", "titlebar", "sidebar", "layout"],
|
||||
when: { !$0.bool(CommandPaletteContextKeys.workspaceMinimalModeEnabled) }
|
||||
)
|
||||
)
|
||||
contributions.append(
|
||||
CommandPaletteCommandContribution(
|
||||
commandId: "palette.disableMinimalMode",
|
||||
title: constant(String(localized: "command.disableMinimalMode.title", defaultValue: "Disable Minimal Mode")),
|
||||
subtitle: constant(String(localized: "command.toggleSidebar.subtitle", defaultValue: "Layout")),
|
||||
keywords: ["minimal", "mode", "titlebar", "sidebar", "layout"],
|
||||
when: { $0.bool(CommandPaletteContextKeys.workspaceMinimalModeEnabled) }
|
||||
)
|
||||
)
|
||||
contributions.append(
|
||||
CommandPaletteCommandContribution(
|
||||
commandId: "palette.triggerFlash",
|
||||
|
|
@ -5711,6 +5731,12 @@ struct ContentView: View {
|
|||
registry.register(commandId: "palette.toggleSidebar") {
|
||||
sidebarState.toggle()
|
||||
}
|
||||
registry.register(commandId: "palette.enableMinimalMode") {
|
||||
workspacePresentationMode = WorkspacePresentationModeSettings.Mode.minimal.rawValue
|
||||
}
|
||||
registry.register(commandId: "palette.disableMinimalMode") {
|
||||
workspacePresentationMode = WorkspacePresentationModeSettings.Mode.standard.rawValue
|
||||
}
|
||||
registry.register(commandId: "palette.triggerFlash") {
|
||||
tabManager.triggerFocusFlash()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue