diff --git a/PowerToys.sln b/PowerToys.sln index 7b981633f..8d6502809 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -547,8 +547,8 @@ Global {4FA206A5-F69F-4193-BF8F-F6EEB496734C}.Debug|x64.Build.0 = Debug|x64 {4FA206A5-F69F-4193-BF8F-F6EEB496734C}.Release|x64.ActiveCfg = Release|x64 {4FA206A5-F69F-4193-BF8F-F6EEB496734C}.Release|x64.Build.0 = Release|x64 - {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1}.Debug|x64.ActiveCfg = Debug|Any CPU - {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1}.Debug|x64.Build.0 = Debug|Any CPU + {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1}.Debug|x64.ActiveCfg = Debug|x64 + {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1}.Debug|x64.Build.0 = Debug|x64 {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1}.Release|x64.ActiveCfg = Release|x64 {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1}.Release|x64.Build.0 = Release|x64 {7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs index 8954644cf..2f8c8df2d 100644 --- a/installer/PowerToysSetup/Product.wxs +++ b/installer/PowerToysSetup/Product.wxs @@ -231,42 +231,34 @@ - - - - - - - - @@ -891,7 +883,7 @@ - + @@ -906,11 +898,6 @@ - - - - - @@ -922,11 +909,6 @@ - - - - - @@ -939,11 +921,6 @@ - - - - - @@ -956,11 +933,6 @@ - - - - - @@ -973,11 +945,6 @@ - - - - - @@ -990,11 +957,6 @@ - - - - - @@ -1006,11 +968,6 @@ - - - - - @@ -1022,11 +979,6 @@ - - - - - diff --git a/src/modules/launcher/Wox.Infrastructure/IAlphabet.cs b/src/common/ManagedCommon/Theme.cs similarity index 51% rename from src/modules/launcher/Wox.Infrastructure/IAlphabet.cs rename to src/common/ManagedCommon/Theme.cs index 6cc89f686..4e0cda2f3 100644 --- a/src/modules/launcher/Wox.Infrastructure/IAlphabet.cs +++ b/src/common/ManagedCommon/Theme.cs @@ -2,10 +2,16 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -namespace Wox.Infrastructure +namespace ManagedCommon { - public interface IAlphabet + public enum Theme { - string Translate(string stringToTranslate); + System, + Light, + Dark, + HighContrastOne, + HighContrastTwo, + HighContrastBlack, + HighContrastWhite, } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj b/src/core/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj index 4deb2dea1..4c9405107 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj +++ b/src/core/Microsoft.PowerToys.Settings.UI.Library/Microsoft.PowerToys.Settings.UI.Library.csproj @@ -51,6 +51,7 @@ + diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Library/PowerLauncherProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Library/PowerLauncherProperties.cs index dc96ff0c1..4bc5a774e 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Library/PowerLauncherProperties.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Library/PowerLauncherProperties.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Text.Json.Serialization; +using ManagedCommon; namespace Microsoft.PowerToys.Settings.UI.Library { @@ -44,6 +45,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library [JsonPropertyName("clear_input_on_launch")] public bool ClearInputOnLaunch { get; set; } + [JsonPropertyName("theme")] + public Theme Theme { get; set; } + public PowerLauncherProperties() { OpenPowerLauncher = new HotkeySettings(false, false, true, false, 32); @@ -56,6 +60,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library DisableDriveDetectionWarning = false; ClearInputOnLaunch = false; MaximumNumberOfResults = 4; + Theme = Theme.System; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs index 89fe413ff..6670f185f 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs @@ -6,6 +6,7 @@ using System; using System.Globalization; using System.Runtime.CompilerServices; using System.Text.Json; +using ManagedCommon; using Microsoft.PowerToys.Settings.UI.Library.Helpers; using Microsoft.PowerToys.Settings.UI.Library.Interfaces; @@ -13,6 +14,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels { public class PowerLauncherViewModel : Observable { + private bool _isDarkThemeRadioButtonChecked; + private bool _isLightThemeRadioButtonChecked; + private bool _isSystemThemeRadioButtonChecked; + private GeneralSettings GeneralSettingsConfig { get; set; } private readonly ISettingsUtils _settingsUtils; @@ -63,6 +68,19 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels settings.Properties.MaximumNumberOfResults = 4; callback(settings); } + + switch (settings.Properties.Theme) + { + case Theme.Light: + _isLightThemeRadioButtonChecked = true; + break; + case Theme.Dark: + _isDarkThemeRadioButtonChecked = true; + break; + case Theme.System: + _isSystemThemeRadioButtonChecked = true; + break; + } } public PowerLauncherViewModel(PowerLauncherSettings settings, SendCallback callback) @@ -149,6 +167,63 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels } } + public bool IsDarkThemeRadioButtonChecked + { + get + { + return _isDarkThemeRadioButtonChecked; + } + + set + { + if (value == true) + { + settings.Properties.Theme = Theme.Dark; + _isDarkThemeRadioButtonChecked = value; + + UpdateSettings(); + } + } + } + + public bool IsLightThemeRadioButtonChecked + { + get + { + return _isLightThemeRadioButtonChecked; + } + + set + { + if (value == true) + { + settings.Properties.Theme = Theme.Light; + _isDarkThemeRadioButtonChecked = value; + + UpdateSettings(); + } + } + } + + public bool IsSystemThemeRadioButtonChecked + { + get + { + return _isSystemThemeRadioButtonChecked; + } + + set + { + if (value == true) + { + settings.Properties.Theme = Theme.System; + _isDarkThemeRadioButtonChecked = value; + + UpdateSettings(); + } + } + } + public HotkeySettings OpenPowerLauncher { get diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index fc053199a..e48dbc073 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -204,10 +204,10 @@ Current Shortcut Remappings - Key remapping + Key Remapping - Shortcut remapping + Shortcut Remapping Remapped to @@ -302,6 +302,9 @@ Clear the previous query on launch + + Choose color + To: Keyboard Manager mapping keys view right header @@ -337,7 +340,7 @@ Open zones editor - Shortcut setting + Set Shortcut Information Symbol @@ -502,7 +505,7 @@ Enable Image Resizer - Image size + Image Size Configurations @@ -511,19 +514,19 @@ Configuration Name - Fit property + Fit Property - Width property + Width Property Height Property - Size property + Size Property - Times symbol + Times Symbol Remove @@ -774,4 +777,16 @@ Example: %1 (%2) + + Dark + + + System default + + + Light + + + Set Shortcut Shortcut setting + \ No newline at end of file diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Styles/TextBlock.xaml b/src/core/Microsoft.PowerToys.Settings.UI/Styles/TextBlock.xaml index f2d332b19..f6f0f9fd7 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Styles/TextBlock.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI/Styles/TextBlock.xaml @@ -22,6 +22,7 @@