mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00

- 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>
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
|
|
namespace SourceGit.Views
|
|
{
|
|
public partial class LauncherPageSwitcher : UserControl
|
|
{
|
|
public LauncherPageSwitcher()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnKeyDown(KeyEventArgs e)
|
|
{
|
|
base.OnKeyDown(e);
|
|
|
|
if (e.Key == Key.Enter && DataContext is ViewModels.LauncherPageSwitcher switcher)
|
|
{
|
|
switcher.Switch();
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
|
|
private void OnItemDoubleTapped(object sender, TappedEventArgs e)
|
|
{
|
|
if (DataContext is ViewModels.LauncherPageSwitcher switcher)
|
|
{
|
|
switcher.Switch();
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
|
|
private void OnSearchBoxKeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.Key == Key.Down && PagesListBox.ItemCount > 0)
|
|
{
|
|
PagesListBox.Focus(NavigationMethod.Directional);
|
|
|
|
if (PagesListBox.SelectedIndex < 0)
|
|
PagesListBox.SelectedIndex = 0;
|
|
else if (PagesListBox.SelectedIndex < PagesListBox.ItemCount)
|
|
PagesListBox.SelectedIndex++;
|
|
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|