refactor: workspace/page switcher (#1330)

- add `Switch Tab` popup
- change hotkey to open `Preferences` to `Ctrl+,/⌘+,`
- change hotkey to open `Switch Workspace` to `Ctrl+Shift+P/⌘+⇧+P`
- change hotkey to open `Switch Tab` to `Ctrl+P/⌘+P`

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-18 19:36:17 +08:00
parent 36c2e083cc
commit 9614b995d8
No known key found for this signature in database
17 changed files with 418 additions and 180 deletions

View file

@ -23,12 +23,6 @@ namespace SourceGit.ViewModels
private set;
}
public WorkspaceSwitcher WorkspaceSwitcher
{
get => _workspaceSwitcher;
set => SetProperty(ref _workspaceSwitcher, value);
}
public Workspace ActiveWorkspace
{
get => _activeWorkspace;
@ -50,6 +44,12 @@ namespace SourceGit.ViewModels
}
}
public object Switcher
{
get => _switcher;
set => SetProperty(ref _switcher, value);
}
public Launcher(string startupRepo)
{
_ignoreIndexChange = true;
@ -138,12 +138,17 @@ namespace SourceGit.ViewModels
public void OpenWorkspaceSwitcher()
{
WorkspaceSwitcher = new WorkspaceSwitcher(this);
Switcher = new WorkspaceSwitcher(this);
}
public void CancelWorkspaceSwitcher()
public void OpenTabSwitcher()
{
WorkspaceSwitcher = null;
Switcher = new LauncherPageSwitcher(this);
}
public void CancelSwitcher()
{
Switcher = null;
}
public void SwitchWorkspace(Workspace to)
@ -618,6 +623,6 @@ namespace SourceGit.ViewModels
private LauncherPage _activePage = null;
private bool _ignoreIndexChange = false;
private string _title = string.Empty;
private WorkspaceSwitcher _workspaceSwitcher = null;
private object _switcher = null;
}
}