mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[Keyboard Manager] Adding KBM to shortcut list on Dashboard page (#45938)
Found during manual testing Open (new) Keyboard Manager shortcut is now shown in the "Shortcuts" menu when the module is enabled and the new editor is being used. <img width="1453" height="1367" alt="image" src="https://github.com/user-attachments/assets/05de4337-9420-460c-b579-8f471a49d4f6" />
This commit is contained in:
@@ -594,6 +594,10 @@ opera.exe</value>
|
||||
<value>Set and manage your remappings</value>
|
||||
<comment>Description for the new editor button</comment>
|
||||
</data>
|
||||
<data name="Dashboard_KeyboardManager_OpenEditor" xml:space="preserve">
|
||||
<value>Open Keyboard Manager</value>
|
||||
<comment>Label for the Keyboard Manager editor shortcut on the dashboard page</comment>
|
||||
</data>
|
||||
<data name="KeyboardManager_GoBackClassic.Content" xml:space="preserve">
|
||||
<value>Switch back to the classic editor</value>
|
||||
<comment>Keyboard Manager link to switch back to the classic editor UI</comment>
|
||||
|
||||
@@ -498,6 +498,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
ModuleType.FancyZones => GetModuleItemsFancyZones(),
|
||||
ModuleType.FindMyMouse => GetModuleItemsFindMyMouse(),
|
||||
ModuleType.Hosts => GetModuleItemsHosts(),
|
||||
ModuleType.KeyboardManager => GetModuleItemsKeyboardManager(),
|
||||
ModuleType.LightSwitch => GetModuleItemsLightSwitch(),
|
||||
ModuleType.MouseHighlighter => GetModuleItemsMouseHighlighter(),
|
||||
ModuleType.MouseJump => GetModuleItemsMouseJump(),
|
||||
@@ -634,6 +635,20 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
return new ObservableCollection<DashboardModuleItem>(list);
|
||||
}
|
||||
|
||||
private ObservableCollection<DashboardModuleItem> GetModuleItemsKeyboardManager()
|
||||
{
|
||||
ISettingsRepository<KeyboardManagerSettings> moduleSettingsRepository = SettingsRepository<KeyboardManagerSettings>.GetInstance(SettingsUtils.Default);
|
||||
var settings = moduleSettingsRepository.SettingsConfig;
|
||||
var list = new List<DashboardModuleItem>();
|
||||
|
||||
if (settings.Properties.UseNewEditor)
|
||||
{
|
||||
list.Add(new DashboardModuleShortcutItem() { Label = resourceLoader.GetString("Dashboard_KeyboardManager_OpenEditor"), Shortcut = settings.Properties.EditorShortcut.GetKeysList() });
|
||||
}
|
||||
|
||||
return new ObservableCollection<DashboardModuleItem>(list);
|
||||
}
|
||||
|
||||
private ObservableCollection<DashboardModuleItem> GetModuleItemsMouseHighlighter()
|
||||
{
|
||||
ISettingsRepository<MouseHighlighterSettings> moduleSettingsRepository = SettingsRepository<MouseHighlighterSettings>.GetInstance(SettingsUtils.Default);
|
||||
|
||||
Reference in New Issue
Block a user