PowerToys/src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs

443 lines
13 KiB
C#
Raw Normal View History

2020-08-17 19:00:56 +02:00
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
2021-02-26 12:21:58 +01:00
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
2021-02-26 12:21:58 +01:00
using System.Linq;
2020-08-17 19:00:56 +02:00
using System.Runtime.CompilerServices;
using System.Text.Json;
2021-08-12 14:53:12 +02:00
using System.Windows.Input;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
2021-08-12 14:53:12 +02:00
using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands;
2020-08-17 19:00:56 +02:00
namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
2020-08-17 19:00:56 +02:00
{
public class PowerLauncherViewModel : Observable
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
private int _themeIndex;
private int _monitorPositionIndex;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
2021-08-12 14:53:12 +02:00
private string _searchText;
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
private GeneralSettings GeneralSettingsConfig { get; set; }
2020-08-17 19:00:56 +02:00
private PowerLauncherSettings settings;
public delegate void SendCallback(PowerLauncherSettings settings);
private readonly SendCallback callback;
2021-02-26 12:21:58 +01:00
private readonly Func<bool> isDark;
private Func<string, int> SendConfigMSG { get; }
public PowerLauncherViewModel(PowerLauncherSettings settings, ISettingsRepository<GeneralSettings> settingsRepository, Func<string, int> ipcMSGCallBackFunc, Func<bool> isDark)
2020-08-17 19:00:56 +02:00
{
if (settings == null)
{
throw new ArgumentException("settings argument can not be null");
}
this.settings = settings;
2021-02-26 12:21:58 +01:00
this.isDark = isDark;
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
// To obtain the general Settings configurations of PowerToys
if (settingsRepository == null)
{
throw new ArgumentNullException(nameof(settingsRepository));
}
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
GeneralSettingsConfig = settingsRepository.SettingsConfig;
2020-09-10 18:44:10 +02:00
// set the callback functions value to hangle outgoing IPC message.
SendConfigMSG = ipcMSGCallBackFunc;
callback = (PowerLauncherSettings s) =>
2020-08-17 19:00:56 +02:00
{
2020-09-10 18:44:10 +02:00
// Propagate changes to Power Launcher through IPC
// Using InvariantCulture as this is an IPC message
2020-09-10 18:44:10 +02:00
SendConfigMSG(
string.Format(
CultureInfo.InvariantCulture,
"{{ \"powertoys\": {{ \"{0}\": {1} }} }}",
PowerLauncherSettings.ModuleName,
JsonSerializer.Serialize(s)));
2020-09-10 18:44:10 +02:00
};
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
switch (settings.Properties.Theme)
{
case Theme.Dark:
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
_themeIndex = 0;
break;
case Theme.Light:
_themeIndex = 1;
break;
case Theme.System:
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
_themeIndex = 2;
break;
}
2021-02-26 12:21:58 +01:00
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
switch (settings.Properties.Position)
{
case StartupPosition.Cursor:
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
_monitorPositionIndex = 0;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
break;
case StartupPosition.PrimaryMonitor:
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
_monitorPositionIndex = 1;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
break;
case StartupPosition.Focus:
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
_monitorPositionIndex = 2;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
break;
}
2021-02-26 12:21:58 +01:00
foreach (var plugin in Plugins)
{
plugin.PropertyChanged += OnPluginInfoChange;
}
2021-08-12 14:53:12 +02:00
SearchPluginsCommand = new RelayCommand(SearchPlugins);
2021-02-26 12:21:58 +01:00
}
private void OnPluginInfoChange(object sender, PropertyChangedEventArgs e)
{
OnPropertyChanged(nameof(ShowAllPluginsDisabledWarning));
UpdateSettings();
2020-08-17 19:00:56 +02:00
}
public PowerLauncherViewModel(PowerLauncherSettings settings, SendCallback callback)
{
this.settings = settings;
this.callback = callback;
}
private void UpdateSettings([CallerMemberName] string propertyName = null)
{
// Notify UI of property change
OnPropertyChanged(propertyName);
callback(settings);
}
public bool EnablePowerLauncher
{
get
{
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
return GeneralSettingsConfig.Enabled.PowerLauncher;
2020-08-17 19:00:56 +02:00
}
set
{
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
if (GeneralSettingsConfig.Enabled.PowerLauncher != value)
2020-08-17 19:00:56 +02:00
{
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
GeneralSettingsConfig.Enabled.PowerLauncher = value;
2020-08-17 19:00:56 +02:00
OnPropertyChanged(nameof(EnablePowerLauncher));
2021-02-26 12:21:58 +01:00
OnPropertyChanged(nameof(ShowAllPluginsDisabledWarning));
OnPropertyChanged(nameof(ShowPluginsLoadingMessage));
Fix for settings crash on toggling enable button for any PowerToy (#6620) * Removed getSettings from moduleEnabled so that it doesn't have to reopen the file everytime * To Lower to while checking the theme * color picker doesn't reopen the file * use the generalView model config directly for FZ * Made the same change for all the viewmodels so that they access the general view model value directly instead of opening and reading the value from a file each time * removed unused variable * Fix initialization in tests * should read the file only if general settings does not exist * Added interfaces for all the powertoys to use the generalSettings singleton class * Runner is responding to changes in settings, only issue is that every time the general settings page is loaded the information is being read because isInitialized property could not be ignored during serialization * All tests pass * Settings and runner are working as expected with the settings cache * added a null check to read from the file only when the settings process is started * use converter to deserialize an interface * Renamed generalSettings within the cache to be called CommonSettingsConfig * All tests pass, had to initialize the common settings config instance * Added few comments to newly created classes * encapsulating load and store of general view model * reading from file is encapsulated * settings and runner wotk with generic singleton * Shortcut guide works as expected * Fancyzones, shortcutguide and power preview use the settings repository and work as expected * referencing GeneralSettings instead of the settingsRepository<GeneralSettings> within viewmodels * unified access to General settings and removed the IGeneralSettingsData interface * Passing settings to viewmodel as a parameter * removed ISettingsConfig interface from the viewmodels which are not using the singleton to access settings * have to use ISettingsConfig to use GetSettings * refactored tests, all tests pass * Added test for settingsRepository that a single instance is created * Added comments and removed unnecessary headers/code * added settings repository tests * moq for each settings file * Img resizer tests pass * General tests pass * FancyZones tests pass * PowerPreview tests pass * PowerRename tests pass * shortcut guide tests pass * Added GetModuleName to ISettingsConfig * unify the way the Modulename is accessed. It was redeclared in multiple places and this would cause an issue if the name is changed only in one place. All the module names are accessed using the <T>Settings.ModuleName, eg: ShortcutGuideSettings.ModuleName. * create PTRun settings file if it does not exist * GetFile is now a private function. Modified the logic of KBM default.json access and PT Run so that we can re-use GetSettings instead of GetFile. * Added UpgradeSettingsConfiguration to the ISettingsConfig interface so that the settings file can be upgraded based on some condition. Presently, only the GeneralSettings file is utilizing this to change the PT Version number based on the old PT version and the current PT version that it receives from the helper function. Verified that if the PT version is lower in the general settings.json file, settings saves the file with the new version info. * The naming for the PowerToys was inconsistent and the variables were redeclared in multiple places. To have the settings.ModuleName as the main name, all other places should refer to that name. In the tests file the module name for ImgResizer was 'ImageResizer' and not 'Image Resizer'. * renamed lock * Remove unnecessary GetSettingsFileNAme function. It is no longer in use because the code does not use types to create a new BasePTModule object
2020-09-23 22:20:32 +02:00
OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(GeneralSettingsConfig);
SendConfigMSG(outgoing.ToString());
2020-08-17 19:00:56 +02:00
}
}
}
public string SearchResultPreference
{
get
{
return settings.Properties.SearchResultPreference;
}
set
{
if (settings.Properties.SearchResultPreference != value)
{
settings.Properties.SearchResultPreference = value;
UpdateSettings();
}
}
}
public string SearchTypePreference
{
get
{
return settings.Properties.SearchTypePreference;
}
set
{
if (settings.Properties.SearchTypePreference != value)
{
settings.Properties.SearchTypePreference = value;
UpdateSettings();
}
}
}
public int MaximumNumberOfResults
{
get
{
return settings.Properties.MaximumNumberOfResults;
}
set
{
if (settings.Properties.MaximumNumberOfResults != value)
{
settings.Properties.MaximumNumberOfResults = value;
UpdateSettings();
}
}
}
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
public int ThemeIndex
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
{
get
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
return _themeIndex;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
}
set
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
switch (value)
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
case 0: settings.Properties.Theme = Theme.Dark; break;
case 1: settings.Properties.Theme = Theme.Light; break;
case 2: settings.Properties.Theme = Theme.System; break;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
}
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
_themeIndex = value;
UpdateSettings();
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
}
}
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
public int MonitorPositionIndex
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
{
get
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
return _monitorPositionIndex;
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
}
set
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
if (_monitorPositionIndex != value)
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
{
[Settings] New UX (#12470) * Removed hardcoded background * Background * Updated pages * Added OOBE to shellpage * Margin fixes * Fix * Resource update * Resource string update * Removed reference from installer file * Updated UI fixes and remove conflicts * Adding new settings control * PowerRename * Sidepanel updates * Shortcut Guide * Updates screeens * General page updates * Awake UX update * Changed order for power preview note * Fixes * UI fixes * KBM * IsEnabled state support * Added new controls * Update * Updated nugest packages * Replaced itemscontrol * Introducing setting button style * FancyZones page * Plugin page * Switch case * Fixed typo * Plugin manager update * Introducing SettingExpander * Setting automation properties * Accesibility improvements * VCM and cleanup * Refactoring OOBE pages part 1 * OOBE XAML refactoring * Added MinWidth to actioncontent controls * Updates to various settings * Spell update * Update to author label * Clean up * Removing redunant files * Move file * Updated files * Revert "Updated files" This reverts commit 1a5c887eae4b4d4989a5e69d531d58227d73adef. * Revert "Move file" This reverts commit 2b06c75c1f91f7a0bbda4c61a7a732dfcedf347e. * Revert "Removing redunant files" This reverts commit fe79ec1701b5670c3d6298a7411964908a839dfe. * Revert "Clean up" This reverts commit 028e15fab6d28fa2519f5a3afa2b7e3e9c2eb297. * Removed redundant styles * Revert "Removed redundant styles" This reverts commit dfdfd65021715b63bae3391518181e3ecbc81330. * Files cleanup * Removing converter, updating background and paddings * Styling updates * Unit test updates * Fixes * Installer fixes * Update Resources.resw * Shell page updates * Updated pagelinks * Styles re-ordering * Updated converter * Updated ToggleSwitch style * Bugfixes * Typo fix * [Settings] New UX - installer dll fixes (#12818) * [Settings] New UX - Fix some failing tests (#12822) * Bugfixes * Typo fix * Hiding VCM * Bugfixes * Download button fix * Remove Newtonsoft.Json from installer file * Updated visuals * Bugfixes * Syntax fix * Updated installer file * Bugfixes * New label * Theming support for OOBE * Put back in Documentation hyperlink * Right uid Co-authored-by: Niels Laute <niels9001@hotmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
2021-08-23 19:48:52 +02:00
switch (value)
{
case 0: settings.Properties.Position = StartupPosition.Cursor; break;
case 1: settings.Properties.Position = StartupPosition.PrimaryMonitor; break;
case 2: settings.Properties.Position = StartupPosition.Focus; break;
}
_monitorPositionIndex = value;
2021-03-31 20:54:10 +02:00
UpdateSettings();
[PT Run] Run dialog now has monitor positioning options (#9492) * Run dialog now has monitor positioning options * add monitor index validation in window position calculation * correct path in page * change how radio buttons are declared to resolve them not being set based on setting * Change "follow mouse" wording Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> * PowerLauncher -> PowerToysRun for new variables/resources * correct header label id and update wording to PowerToys Run * only enable custom index if BOTH custom position radio checked and Run is enabled * retrieve list count of detected monitors to limit selection of MonitorToDisplayOn * add a link to Windows Display settings * fix display settings link * change how we get the number of connected monitors so we're not relying on presentation core, windowsbase etc which seem to fail the build * combine position and appearance headers * change references for custom position to "focus" * restore accidentally removed files * remove unused directives * hook up "active window" position with the launcher window * remove left overs * remove uneeded itemgroup * make resource prefixes consistent; using "Run_" * add etcoreapp to spell check * undo change to file not modified in the end * remove unused checkbox post rebase * remove change to reduce diff size * changes according to review * revert whitespace changes post rebase * revert resources * add changes back * Update src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw Add comment Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com> * remove unneeded resource string Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
2021-03-09 18:20:49 +01:00
}
}
}
2021-08-12 14:53:12 +02:00
public string SearchText
{
get
{
return _searchText;
}
set
{
if (_searchText != value)
{
_searchText = value;
OnPropertyChanged(nameof(SearchText));
}
}
}
public ICommand SearchPluginsCommand { get; }
2020-08-17 19:00:56 +02:00
public HotkeySettings OpenPowerLauncher
{
get
{
return settings.Properties.OpenPowerLauncher;
}
set
{
if (settings.Properties.OpenPowerLauncher != value)
{
settings.Properties.OpenPowerLauncher = value;
UpdateSettings();
}
}
}
public bool UseCentralizedKeyboardHook
{
get
{
return settings.Properties.UseCentralizedKeyboardHook;
}
set
{
if (settings.Properties.UseCentralizedKeyboardHook != value)
{
settings.Properties.UseCentralizedKeyboardHook = value;
UpdateSettings();
}
}
2020-08-17 19:00:56 +02:00
}
public HotkeySettings OpenFileLocation
{
get
{
return settings.Properties.OpenFileLocation;
}
set
{
if (settings.Properties.OpenFileLocation != value)
{
settings.Properties.OpenFileLocation = value;
UpdateSettings();
}
}
}
public HotkeySettings CopyPathLocation
{
get
{
return settings.Properties.CopyPathLocation;
}
set
{
if (settings.Properties.CopyPathLocation != value)
{
settings.Properties.CopyPathLocation = value;
UpdateSettings();
}
}
}
public bool OverrideWinRKey
{
get
{
return settings.Properties.OverrideWinkeyR;
}
set
{
if (settings.Properties.OverrideWinkeyR != value)
{
settings.Properties.OverrideWinkeyR = value;
UpdateSettings();
}
}
}
public bool OverrideWinSKey
{
get
{
return settings.Properties.OverrideWinkeyS;
}
set
{
if (settings.Properties.OverrideWinkeyS != value)
{
settings.Properties.OverrideWinkeyS = value;
UpdateSettings();
}
}
}
public bool IgnoreHotkeysInFullScreen
{
get
{
return settings.Properties.IgnoreHotkeysInFullscreen;
}
set
{
if (settings.Properties.IgnoreHotkeysInFullscreen != value)
{
settings.Properties.IgnoreHotkeysInFullscreen = value;
UpdateSettings();
}
}
}
public bool ClearInputOnLaunch
{
get
{
return settings.Properties.ClearInputOnLaunch;
}
set
{
if (settings.Properties.ClearInputOnLaunch != value)
{
settings.Properties.ClearInputOnLaunch = value;
UpdateSettings();
}
}
}
2021-02-26 12:21:58 +01:00
private ObservableCollection<PowerLauncherPluginViewModel> _plugins;
public ObservableCollection<PowerLauncherPluginViewModel> Plugins
2020-08-17 19:00:56 +02:00
{
get
{
2021-02-26 12:21:58 +01:00
if (_plugins == null)
2020-08-17 19:00:56 +02:00
{
2021-02-26 12:21:58 +01:00
_plugins = new ObservableCollection<PowerLauncherPluginViewModel>(settings.Plugins.Select(x => new PowerLauncherPluginViewModel(x, isDark)));
2020-08-17 19:00:56 +02:00
}
2021-02-26 12:21:58 +01:00
return _plugins;
2020-08-17 19:00:56 +02:00
}
}
2021-02-26 12:21:58 +01:00
public bool ShowAllPluginsDisabledWarning
{
get => EnablePowerLauncher && Plugins.Any() && Plugins.All(x => x.Disabled);
}
public bool ShowPluginsLoadingMessage
{
get => EnablePowerLauncher && !Plugins.Any();
2021-02-26 12:21:58 +01:00
}
public bool IsUpToDate(PowerLauncherSettings settings)
{
return this.settings.Equals(settings);
}
2021-08-12 14:53:12 +02:00
public void SearchPlugins()
{
if (!string.IsNullOrWhiteSpace(SearchText))
{
var plugins = settings.Plugins.Where(p => p.Name.StartsWith(SearchText, StringComparison.OrdinalIgnoreCase) || p.Name.IndexOf($" {SearchText}", StringComparison.OrdinalIgnoreCase) > 0);
_plugins = new ObservableCollection<PowerLauncherPluginViewModel>(plugins.Select(x => new PowerLauncherPluginViewModel(x, isDark)));
}
else
{
_plugins = null;
}
OnPropertyChanged(nameof(Plugins));
}
2020-08-17 19:00:56 +02:00
}
}