mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-23 03:14:59 +00:00
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:
parent
36c2e083cc
commit
9614b995d8
17 changed files with 418 additions and 180 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue