mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[Settings]Fix minor issues in showing shortcuts in Flyout and Dashboard (#31754)
This commit is contained in:
committed by
GitHub
parent
a36e119204
commit
c41c9b6107
@@ -18,7 +18,6 @@ using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.UI;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
@@ -443,9 +442,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
private ObservableCollection<DashboardModuleItem> GetModuleItemsShortcutGuide()
|
||||
{
|
||||
ISettingsRepository<ShortcutGuideSettings> moduleSettingsRepository = SettingsRepository<ShortcutGuideSettings>.GetInstance(new SettingsUtils());
|
||||
|
||||
var shortcut = moduleSettingsRepository.SettingsConfig.Properties.UseLegacyPressWinKeyBehavior.Value
|
||||
? new List<object> { 92 } // Right Windows key code
|
||||
: moduleSettingsRepository.SettingsConfig.Properties.OpenShortcutGuide.GetKeysList();
|
||||
|
||||
var list = new List<DashboardModuleItem>
|
||||
{
|
||||
new DashboardModuleShortcutItem() { Label = resourceLoader.GetString("ShortcutGuide_ShortDescription"), Shortcut = moduleSettingsRepository.SettingsConfig.Properties.OpenShortcutGuide.GetKeysList() },
|
||||
new DashboardModuleShortcutItem() { Label = resourceLoader.GetString("ShortcutGuide_ShortDescription"), Shortcut = shortcut },
|
||||
};
|
||||
return new ObservableCollection<DashboardModuleItem>(list);
|
||||
}
|
||||
|
||||
@@ -76,12 +76,12 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
Label = resourceLoader.GetString(ModuleHelper.GetModuleLabelResourceName(moduleType)),
|
||||
Tag = moduleType,
|
||||
Visible = ModuleHelper.GetIsModuleEnabled(generalSettingsConfig, moduleType),
|
||||
ToolTip = GetModuleTooltip(moduleType),
|
||||
ToolTip = GetModuleToolTip(moduleType),
|
||||
Icon = ModuleHelper.GetModuleTypeFluentIconName(moduleType),
|
||||
});
|
||||
}
|
||||
|
||||
private string GetModuleTooltip(ModuleType moduleType)
|
||||
private string GetModuleToolTip(ModuleType moduleType)
|
||||
{
|
||||
return moduleType switch
|
||||
{
|
||||
@@ -90,7 +90,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
ModuleType.PowerLauncher => SettingsRepository<PowerLauncherSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.OpenPowerLauncher.ToString(),
|
||||
ModuleType.PowerOCR => SettingsRepository<PowerOcrSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.ActivationShortcut.ToString(),
|
||||
ModuleType.MeasureTool => SettingsRepository<MeasureToolSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.ActivationShortcut.ToString(),
|
||||
ModuleType.ShortcutGuide => SettingsRepository<ShortcutGuideSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.OpenShortcutGuide.ToString(),
|
||||
ModuleType.ShortcutGuide => GetShortcutGuideToolTip(),
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
@@ -105,6 +105,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private string GetShortcutGuideToolTip()
|
||||
{
|
||||
var shortcutGuideSettings = SettingsRepository<ShortcutGuideSettings>.GetInstance(new SettingsUtils()).SettingsConfig;
|
||||
return shortcutGuideSettings.Properties.UseLegacyPressWinKeyBehavior.Value
|
||||
? "Win"
|
||||
: shortcutGuideSettings.Properties.OpenShortcutGuide.ToString();
|
||||
}
|
||||
|
||||
internal void StartBugReport()
|
||||
{
|
||||
SendIPCMessage("{\"bugreport\": 0 }");
|
||||
|
||||
Reference in New Issue
Block a user