mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
[Settings]Fix ColorPicker dashboard shortcut (#37547)
* Fix color picker dashboard shortcut * remove not needed code * Remove comment
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
ViewModel = new ColorPickerViewModel(
|
ViewModel = new ColorPickerViewModel(
|
||||||
settingsUtils,
|
settingsUtils,
|
||||||
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
||||||
null,
|
SettingsRepository<ColorPickerSettings>.GetInstance(settingsUtils),
|
||||||
ShellPage.SendDefaultIPCMessage);
|
ShellPage.SendDefaultIPCMessage);
|
||||||
DataContext = ViewModel;
|
DataContext = ViewModel;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|||||||
@@ -57,15 +57,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
|
|
||||||
_settingsUtils = settingsUtils ?? throw new ArgumentNullException(nameof(settingsUtils));
|
_settingsUtils = settingsUtils ?? throw new ArgumentNullException(nameof(settingsUtils));
|
||||||
|
|
||||||
if (colorPickerSettingsRepository == null)
|
_colorPickerSettings = colorPickerSettingsRepository.SettingsConfig;
|
||||||
{
|
|
||||||
// used in release. This method converts the settings stored in the previous form, so we have forwards compatibility
|
|
||||||
_colorPickerSettings = _settingsUtils.GetSettingsOrDefault<ColorPickerSettings, ColorPickerSettingsVersion1>(ColorPickerSettings.ModuleName, settingsUpgrader: ColorPickerSettings.UpgradeSettings);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_colorPickerSettings = colorPickerSettingsRepository.SettingsConfig; // used in the unit tests
|
|
||||||
}
|
|
||||||
|
|
||||||
InitializeEnabledValue();
|
InitializeEnabledValue();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user