mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
Compare commits
4 commits
d3d0e7b15c
...
ea320d2cdf
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ea320d2cdf | ||
![]() |
01945f231e | ||
![]() |
506dbc218c | ||
![]() |
d3a740fb95 |
7 changed files with 122 additions and 22 deletions
|
@ -6,13 +6,15 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in de_DE.axaml</summary>
|
<summary>Missing keys in de_DE.axaml</summary>
|
||||||
|
|
||||||
- Text.GitFlow.FinishWithPush
|
- Text.GitFlow.FinishWithPush
|
||||||
- Text.GitFlow.FinishWithSquash
|
- Text.GitFlow.FinishWithSquash
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
||||||
- Text.Repository.ShowSubmodulesAsTree
|
- Text.Repository.ShowSubmodulesAsTree
|
||||||
- Text.Submodule.Status
|
- Text.Submodule.Status
|
||||||
|
@ -24,23 +26,17 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in es_ES.axaml</summary>
|
<summary>Missing keys in es_ES.axaml</summary>
|
||||||
|
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
- Text.Repository.ShowSubmodulesAsTree
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Submodule.Status
|
|
||||||
- Text.Submodule.Status.Modified
|
|
||||||
- Text.Submodule.Status.NotInited
|
|
||||||
- Text.Submodule.Status.RevisionChanged
|
|
||||||
- Text.Submodule.Status.Unmerged
|
|
||||||
- Text.Submodule.URL
|
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in fr_FR.axaml</summary>
|
<summary>Missing keys in fr_FR.axaml</summary>
|
||||||
|
@ -64,6 +60,8 @@ This document shows the translation status of each locale file in the repository
|
||||||
- Text.ConfirmEmptyCommit.WithLocalChanges
|
- Text.ConfirmEmptyCommit.WithLocalChanges
|
||||||
- Text.GitFlow.FinishWithPush
|
- Text.GitFlow.FinishWithPush
|
||||||
- Text.GitFlow.FinishWithSquash
|
- Text.GitFlow.FinishWithSquash
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
||||||
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
||||||
- Text.Repository.BranchSort
|
- Text.Repository.BranchSort
|
||||||
|
@ -91,9 +89,17 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
### 
|
<details>
|
||||||
|
<summary>Missing keys in it_IT.axaml</summary>
|
||||||
|
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in ja_JP.axaml</summary>
|
<summary>Missing keys in ja_JP.axaml</summary>
|
||||||
|
@ -117,6 +123,8 @@ This document shows the translation status of each locale file in the repository
|
||||||
- Text.ConfirmEmptyCommit.WithLocalChanges
|
- Text.ConfirmEmptyCommit.WithLocalChanges
|
||||||
- Text.GitFlow.FinishWithPush
|
- Text.GitFlow.FinishWithPush
|
||||||
- Text.GitFlow.FinishWithSquash
|
- Text.GitFlow.FinishWithSquash
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
||||||
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
||||||
- Text.Repository.BranchSort
|
- Text.Repository.BranchSort
|
||||||
|
@ -146,7 +154,7 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in pt_BR.axaml</summary>
|
<summary>Missing keys in pt_BR.axaml</summary>
|
||||||
|
@ -199,6 +207,8 @@ This document shows the translation status of each locale file in the repository
|
||||||
- Text.GitFlow.FinishWithPush
|
- Text.GitFlow.FinishWithPush
|
||||||
- Text.GitFlow.FinishWithSquash
|
- Text.GitFlow.FinishWithSquash
|
||||||
- Text.Hotkeys.Global.Clone
|
- Text.Hotkeys.Global.Clone
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
||||||
- Text.InProgress.CherryPick.Head
|
- Text.InProgress.CherryPick.Head
|
||||||
- Text.InProgress.Merge.Operating
|
- Text.InProgress.Merge.Operating
|
||||||
|
@ -264,16 +274,18 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in ru_RU.axaml</summary>
|
<summary>Missing keys in ru_RU.axaml</summary>
|
||||||
|
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Repository.ShowSubmodulesAsTree
|
- Text.Repository.ShowSubmodulesAsTree
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in ta_IN.axaml</summary>
|
<summary>Missing keys in ta_IN.axaml</summary>
|
||||||
|
@ -297,6 +309,8 @@ This document shows the translation status of each locale file in the repository
|
||||||
- Text.ConfirmEmptyCommit.WithLocalChanges
|
- Text.ConfirmEmptyCommit.WithLocalChanges
|
||||||
- Text.GitFlow.FinishWithPush
|
- Text.GitFlow.FinishWithPush
|
||||||
- Text.GitFlow.FinishWithSquash
|
- Text.GitFlow.FinishWithSquash
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
||||||
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
||||||
- Text.Repository.BranchSort
|
- Text.Repository.BranchSort
|
||||||
|
@ -324,7 +338,7 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Missing keys in uk_UA.axaml</summary>
|
<summary>Missing keys in uk_UA.axaml</summary>
|
||||||
|
@ -344,6 +358,8 @@ This document shows the translation status of each locale file in the repository
|
||||||
- Text.ConfigureWorkspace.Name
|
- Text.ConfigureWorkspace.Name
|
||||||
- Text.GitFlow.FinishWithPush
|
- Text.GitFlow.FinishWithPush
|
||||||
- Text.GitFlow.FinishWithSquash
|
- Text.GitFlow.FinishWithSquash
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
- Text.Hotkeys.TextEditor.OpenExternalMergeTool
|
||||||
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
- Text.Preferences.Git.IgnoreCRAtEOLInDiff
|
||||||
- Text.Repository.BranchSort
|
- Text.Repository.BranchSort
|
||||||
|
@ -366,6 +382,22 @@ This document shows the translation status of each locale file in the repository
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 
|
### 
|
||||||
|
|
||||||
### 
|
<details>
|
||||||
|
<summary>Missing keys in zh_CN.axaml</summary>
|
||||||
|
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Missing keys in zh_TW.axaml</summary>
|
||||||
|
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaces
|
||||||
|
- Text.Hotkeys.Global.OpenWorkspaceAtIndex
|
||||||
|
|
||||||
|
</details>
|
|
@ -386,6 +386,8 @@
|
||||||
<x:String x:Key="Text.Hotkeys.Global.GotoPrevTab" xml:space="preserve">Go to previous page</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.GotoPrevTab" xml:space="preserve">Go to previous page</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Global.NewTab" xml:space="preserve">Create new page</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.NewTab" xml:space="preserve">Create new page</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Global.OpenPreferences" xml:space="preserve">Open Preferences dialog</x:String>
|
<x:String x:Key="Text.Hotkeys.Global.OpenPreferences" xml:space="preserve">Open Preferences dialog</x:String>
|
||||||
|
<x:String x:Key="Text.Hotkeys.Global.OpenWorkspaces" xml:space="preserve">Open Workspaces dialog</x:String>
|
||||||
|
<x:String x:Key="Text.Hotkeys.Global.OpenWorkspaceAtIndex" xml:space="preserve">Switch to corresponding workspace</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">REPOSITORY</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">REPOSITORY</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.Commit" xml:space="preserve">Commit staged changes</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.Commit" xml:space="preserve">Commit staged changes</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.Repo.CommitAndPush" xml:space="preserve">Commit and push staged changes</x:String>
|
<x:String x:Key="Text.Hotkeys.Repo.CommitAndPush" xml:space="preserve">Commit and push staged changes</x:String>
|
||||||
|
|
|
@ -410,6 +410,7 @@
|
||||||
<x:String x:Key="Text.Hotkeys.TextEditor.CloseSearch" xml:space="preserve">Cerrar panel de búsqueda</x:String>
|
<x:String x:Key="Text.Hotkeys.TextEditor.CloseSearch" xml:space="preserve">Cerrar panel de búsqueda</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.TextEditor.GotoNextMatch" xml:space="preserve">Buscar siguiente coincidencia</x:String>
|
<x:String x:Key="Text.Hotkeys.TextEditor.GotoNextMatch" xml:space="preserve">Buscar siguiente coincidencia</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.TextEditor.GotoPrevMatch" xml:space="preserve">Buscar coincidencia anterior</x:String>
|
<x:String x:Key="Text.Hotkeys.TextEditor.GotoPrevMatch" xml:space="preserve">Buscar coincidencia anterior</x:String>
|
||||||
|
<x:String x:Key="Text.Hotkeys.TextEditor.OpenExternalMergeTool" xml:space="preserve">Abrir con herramienta diff/merge externa</x:String>
|
||||||
<x:String x:Key="Text.Hotkeys.TextEditor.Search" xml:space="preserve">Abrir panel de búsqueda</x:String>
|
<x:String x:Key="Text.Hotkeys.TextEditor.Search" xml:space="preserve">Abrir panel de búsqueda</x:String>
|
||||||
<x:String x:Key="Text.Hunk.Discard" xml:space="preserve">Descartar</x:String>
|
<x:String x:Key="Text.Hunk.Discard" xml:space="preserve">Descartar</x:String>
|
||||||
<x:String x:Key="Text.Hunk.Stage" xml:space="preserve">Stage</x:String>
|
<x:String x:Key="Text.Hunk.Stage" xml:space="preserve">Stage</x:String>
|
||||||
|
@ -620,6 +621,7 @@
|
||||||
<x:String x:Key="Text.Repository.Search.ByMessage" xml:space="preserve">Mensaje</x:String>
|
<x:String x:Key="Text.Repository.Search.ByMessage" xml:space="preserve">Mensaje</x:String>
|
||||||
<x:String x:Key="Text.Repository.Search.BySHA" xml:space="preserve">SHA</x:String>
|
<x:String x:Key="Text.Repository.Search.BySHA" xml:space="preserve">SHA</x:String>
|
||||||
<x:String x:Key="Text.Repository.Search.InCurrentBranch" xml:space="preserve">Rama Actual</x:String>
|
<x:String x:Key="Text.Repository.Search.InCurrentBranch" xml:space="preserve">Rama Actual</x:String>
|
||||||
|
<x:String x:Key="Text.Repository.ShowSubmodulesAsTree" xml:space="preserve">Mostrar Submódulos como Árbol</x:String>
|
||||||
<x:String x:Key="Text.Repository.ShowTagsAsTree" xml:space="preserve">Mostrar Etiquetas como Árbol</x:String>
|
<x:String x:Key="Text.Repository.ShowTagsAsTree" xml:space="preserve">Mostrar Etiquetas como Árbol</x:String>
|
||||||
<x:String x:Key="Text.Repository.Skip" xml:space="preserve">OMITIR</x:String>
|
<x:String x:Key="Text.Repository.Skip" xml:space="preserve">OMITIR</x:String>
|
||||||
<x:String x:Key="Text.Repository.Statistics" xml:space="preserve">Estadísticas</x:String>
|
<x:String x:Key="Text.Repository.Statistics" xml:space="preserve">Estadísticas</x:String>
|
||||||
|
@ -708,6 +710,12 @@
|
||||||
<x:String x:Key="Text.Submodule.RelativePath" xml:space="preserve">Ruta Relativa:</x:String>
|
<x:String x:Key="Text.Submodule.RelativePath" xml:space="preserve">Ruta Relativa:</x:String>
|
||||||
<x:String x:Key="Text.Submodule.RelativePath.Placeholder" xml:space="preserve">Carpeta relativa para almacenar este módulo.</x:String>
|
<x:String x:Key="Text.Submodule.RelativePath.Placeholder" xml:space="preserve">Carpeta relativa para almacenar este módulo.</x:String>
|
||||||
<x:String x:Key="Text.Submodule.Remove" xml:space="preserve">Eliminar Submódulo</x:String>
|
<x:String x:Key="Text.Submodule.Remove" xml:space="preserve">Eliminar Submódulo</x:String>
|
||||||
|
<x:String x:Key="Text.Submodule.Status" xml:space="preserve">ESTADO</x:String>
|
||||||
|
<x:String x:Key="Text.Submodule.Status.Modified" xml:space="preserve">modificado</x:String>
|
||||||
|
<x:String x:Key="Text.Submodule.Status.NotInited" xml:space="preserve">no inicializado</x:String>
|
||||||
|
<x:String x:Key="Text.Submodule.Status.RevisionChanged" xml:space="preserve">revisión cambiada</x:String>
|
||||||
|
<x:String x:Key="Text.Submodule.Status.Unmerged" xml:space="preserve">unmerged</x:String>
|
||||||
|
<x:String x:Key="Text.Submodule.URL" xml:space="preserve">URL</x:String>
|
||||||
<x:String x:Key="Text.Sure" xml:space="preserve">OK</x:String>
|
<x:String x:Key="Text.Sure" xml:space="preserve">OK</x:String>
|
||||||
<x:String x:Key="Text.TagCM.Copy" xml:space="preserve">Copiar Nombre de la Etiqueta</x:String>
|
<x:String x:Key="Text.TagCM.Copy" xml:space="preserve">Copiar Nombre de la Etiqueta</x:String>
|
||||||
<x:String x:Key="Text.TagCM.CopyMessage" xml:space="preserve">Copiar Mensaje de la Etiqueta</x:String>
|
<x:String x:Key="Text.TagCM.CopyMessage" xml:space="preserve">Copiar Mensaje de la Etiqueta</x:String>
|
||||||
|
|
|
@ -463,6 +463,14 @@ namespace SourceGit.ViewModels
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SwitchWorkspace(int idx)
|
||||||
|
{
|
||||||
|
var pref = Preferences.Instance;
|
||||||
|
if (idx >= pref.Workspaces.Count || pref.Workspaces[idx].IsActive) return;
|
||||||
|
|
||||||
|
SwitchWorkspace(pref.Workspaces[idx]);
|
||||||
|
}
|
||||||
|
|
||||||
private string GetRepositoryGitDir(string repo)
|
private string GetRepositoryGitDir(string repo)
|
||||||
{
|
{
|
||||||
var fullpath = Path.Combine(repo, ".git");
|
var fullpath = Path.Combine(repo, ".git");
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}"
|
FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}"
|
||||||
Margin="0,0,0,8"/>
|
Margin="0,0,0,8"/>
|
||||||
|
|
||||||
<Grid RowDefinitions="20,20,20,20,20,20,20,20" ColumnDefinitions="150,*">
|
<Grid RowDefinitions="20,20,20,20,20,20,20,20,20,20" ColumnDefinitions="150,*">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Shift+P, macOS=⌘+\,}"/>
|
<TextBlock Grid.Row="0" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Shift+P, macOS=⌘+\,}"/>
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.OpenPreferences}"/>
|
<TextBlock Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.OpenPreferences}"/>
|
||||||
|
|
||||||
|
@ -69,6 +69,12 @@
|
||||||
|
|
||||||
<TextBlock Grid.Row="7" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Q, macOS=⌘+Q}"/>
|
<TextBlock Grid.Row="7" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Q, macOS=⌘+Q}"/>
|
||||||
<TextBlock Grid.Row="7" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Quit}" />
|
<TextBlock Grid.Row="7" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Quit}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="8" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Alt+Space, macOS=⌥+␣}"/>
|
||||||
|
<TextBlock Grid.Row="8" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.OpenWorkspaces}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="9" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Alt+1 - Alt+9, macOS=⌥+1 - ⌥+9}"/>
|
||||||
|
<TextBlock Grid.Row="9" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.OpenWorkspaceAtIndex}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<TextBlock Text="{DynamicResource Text.Hotkeys.Repo}"
|
<TextBlock Text="{DynamicResource Text.Hotkeys.Repo}"
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<!-- Workspace Switcher -->
|
<!-- Workspace Switcher -->
|
||||||
<Button Grid.Column="1" Classes="icon_button" VerticalAlignment="Bottom" Margin="0,0,0,1" Click="OnOpenWorkspaceMenu">
|
<Button Grid.Column="1" Classes="icon_button" Name="WorkspacesButton" VerticalAlignment="Bottom" Margin="0,0,0,1" Click="OnOpenWorkspaceMenu">
|
||||||
<ToolTip.Tip>
|
<ToolTip.Tip>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{DynamicResource Text.Workspace}" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}"/>
|
<TextBlock Text="{DynamicResource Text.Workspace}" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}"/>
|
||||||
|
|
|
@ -248,6 +248,27 @@ namespace SourceGit.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (e.KeyModifiers.HasFlag(KeyModifiers.Alt))
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Space && DataContext is ViewModels.Launcher launcher)
|
||||||
|
{
|
||||||
|
var menu = launcher.CreateContextForWorkspace();
|
||||||
|
var workspacesButton = this.FindControl<Button>("WorkspacesButton");
|
||||||
|
if (menu != null)
|
||||||
|
{
|
||||||
|
menu.PlacementTarget = workspacesButton;
|
||||||
|
menu.Placement = PlacementMode.BottomEdgeAlignedLeft;
|
||||||
|
menu.Open(workspacesButton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SwitchToWorkspaceIndex(e.Key);
|
||||||
|
}
|
||||||
|
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
else if (e.Key == Key.Escape)
|
else if (e.Key == Key.Escape)
|
||||||
{
|
{
|
||||||
vm.ActivePage.CancelPopup();
|
vm.ActivePage.CancelPopup();
|
||||||
|
@ -282,6 +303,29 @@ namespace SourceGit.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SwitchToWorkspaceIndex(Key eKey)
|
||||||
|
{
|
||||||
|
int newIndex;
|
||||||
|
switch (eKey)
|
||||||
|
{
|
||||||
|
case Key.D1 or Key.NumPad1: newIndex = 0; break;
|
||||||
|
case Key.D2 or Key.NumPad2: newIndex = 1; break;
|
||||||
|
case Key.D3 or Key.NumPad3: newIndex = 2; break;
|
||||||
|
case Key.D4 or Key.NumPad4: newIndex = 3; break;
|
||||||
|
case Key.D5 or Key.NumPad5: newIndex = 4; break;
|
||||||
|
case Key.D6 or Key.NumPad6: newIndex = 5; break;
|
||||||
|
case Key.D7 or Key.NumPad7: newIndex = 6; break;
|
||||||
|
case Key.D8 or Key.NumPad8: newIndex = 7; break;
|
||||||
|
case Key.D9 or Key.NumPad9: newIndex = 8; break;
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DataContext is ViewModels.Launcher launcher)
|
||||||
|
{
|
||||||
|
launcher.SwitchWorkspace(newIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnKeyUp(KeyEventArgs e)
|
protected override void OnKeyUp(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnKeyUp(e);
|
base.OnKeyUp(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue