From 52dad2f005c557c069e07c04aabe60d1736b2d8b Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 24 Jul 2021 21:46:21 +0200 Subject: [PATCH] Add hotkeys for focusing the toolbar combo boxes --- ILSpy/MainWindow.xaml | 2 +- ILSpy/MainWindow.xaml.cs | 23 +++++++++++++++++++++++ ILSpy/Properties/Resources.Designer.cs | 24 ++++++++++++------------ ILSpy/Properties/Resources.resx | 12 ++++++------ ILSpy/Properties/Resources.zh-Hans.resx | 6 +++--- 5 files changed, 45 insertions(+), 22 deletions(-) diff --git a/ILSpy/MainWindow.xaml b/ILSpy/MainWindow.xaml index 36b0649f0..8a20d45cb 100644 --- a/ILSpy/MainWindow.xaml +++ b/ILSpy/MainWindow.xaml @@ -107,7 +107,7 @@ - + diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 7e3132d0e..89d711c95 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -371,6 +371,29 @@ namespace ICSharpCode.ILSpy } #endregion + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + if (!e.Handled && e.KeyboardDevice.Modifiers == ModifierKeys.Alt && e.Key == Key.System) + { + switch (e.SystemKey) + { + case Key.A: + assemblyListComboBox.Focus(); + e.Handled = true; + break; + case Key.L: + languageComboBox.Focus(); + e.Handled = true; + break; + case Key.E: // Alt+V was already taken by _View menu + languageVersionComboBox.Focus(); + e.Handled = true; + break; + } + } + } + public AssemblyList CurrentAssemblyList { get { return assemblyList; } } diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs index 8d8550eb3..302ff79c6 100644 --- a/ILSpy/Properties/Resources.Designer.cs +++ b/ILSpy/Properties/Resources.Designer.cs @@ -1712,15 +1712,6 @@ namespace ICSharpCode.ILSpy.Properties { } } - /// - /// Looks up a localized string similar to Language. - /// - public static string Language { - get { - return ResourceManager.GetString("Language", resourceCulture); - } - } - /// /// Looks up a localized string similar to Are you sure that you want to delete the selected assembly list?. /// @@ -2238,7 +2229,7 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Select a list of assemblies. + /// Looks up a localized string similar to Select a list of assemblies (Alt+A). /// public static string SelectAssemblyListDropdownTooltip { get { @@ -2247,7 +2238,7 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Select language to decompile to. + /// Looks up a localized string similar to Select language to decompile to (Alt+L). /// public static string SelectLanguageDropdownTooltip { get { @@ -2274,7 +2265,7 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Select version of language to output. + /// Looks up a localized string similar to Select version of language to output (Alt+E). /// public static string SelectVersionDropdownTooltip { get { @@ -2543,6 +2534,15 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// Looks up a localized string similar to UI Language. + /// + public static string UILanguage { + get { + return ResourceManager.GetString("UILanguage", resourceCulture); + } + } + /// /// Looks up a localized string similar to System. /// diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx index 5641b507a..80b5a36ad 100644 --- a/ILSpy/Properties/Resources.resx +++ b/ILSpy/Properties/Resources.resx @@ -591,9 +591,6 @@ Are you sure you want to continue? Insert using declarations - - Language - Are you sure that you want to delete the selected assembly list? @@ -769,10 +766,10 @@ Do you want to continue? Select assemblies to open: - Select a list of assemblies + Select a list of assemblies (Alt+A) - Select language to decompile to + Select language to decompile to (Alt+L) Select a list: @@ -781,7 +778,7 @@ Do you want to continue? Select PDB... - Select version of language to output + Select version of language to output (Alt+E) You must restart ILSpy for the change to take effect. @@ -870,6 +867,9 @@ Do you want to continue? Type + + UI Language + System diff --git a/ILSpy/Properties/Resources.zh-Hans.resx b/ILSpy/Properties/Resources.zh-Hans.resx index 594ac91ee..fb8c6cc94 100644 --- a/ILSpy/Properties/Resources.zh-Hans.resx +++ b/ILSpy/Properties/Resources.zh-Hans.resx @@ -585,9 +585,6 @@ 插入使用声明 - - 语言 - 是否删除选中的程序集列表? @@ -858,6 +855,9 @@ 类型 + + 语言 + 系统