mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PT Settings] Opening windows color settings from inside PT (#9589)
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
// 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.Diagnostics;
|
||||||
|
|
||||||
|
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||||
|
{
|
||||||
|
public static class StartProcessHelper
|
||||||
|
{
|
||||||
|
public const string ColorsSettings = "ms-settings:colors";
|
||||||
|
|
||||||
|
public static void Start(string process)
|
||||||
|
{
|
||||||
|
Process.Start(new ProcessStartInfo(process) { UseShellExecute = true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -108,6 +108,7 @@
|
|||||||
<Compile Include="Helpers\Observable.cs" />
|
<Compile Include="Helpers\Observable.cs" />
|
||||||
<Compile Include="Helpers\RelayCommand.cs" />
|
<Compile Include="Helpers\RelayCommand.cs" />
|
||||||
<Compile Include="Helpers\ResourceExtensions.cs" />
|
<Compile Include="Helpers\ResourceExtensions.cs" />
|
||||||
|
<Compile Include="Helpers\StartProcessHelper.cs" />
|
||||||
<Compile Include="ICoreWindowInterop.cs" />
|
<Compile Include="ICoreWindowInterop.cs" />
|
||||||
<Compile Include="Interop.cs" />
|
<Compile Include="Interop.cs" />
|
||||||
<Compile Include="Services\ActivationService.cs" />
|
<Compile Include="Services\ActivationService.cs" />
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
<RadioButton x:Uid="Radio_Theme_Default"
|
<RadioButton x:Uid="Radio_Theme_Default"
|
||||||
IsChecked="{ Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}"/>
|
IsChecked="{ Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}"/>
|
||||||
<HyperlinkButton NavigateUri="ms-settings:colors">
|
<HyperlinkButton Click="OpenColorsSettings_Click">
|
||||||
<TextBlock x:Uid="Windows_Color_Settings" />
|
<TextBlock x:Uid="Windows_Color_Settings" />
|
||||||
</HyperlinkButton>
|
</HyperlinkButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -117,5 +117,10 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OpenColorsSettings_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Helpers.StartProcessHelper.Start(Helpers.StartProcessHelper.ColorsSettings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
<RadioButton x:Uid="Radio_Theme_Default"
|
<RadioButton x:Uid="Radio_Theme_Default"
|
||||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
|
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
|
||||||
IsChecked="{Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}" />
|
IsChecked="{Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}" />
|
||||||
<HyperlinkButton NavigateUri="ms-settings:colors">
|
<HyperlinkButton Click="OpenColorsSettings_Click">
|
||||||
<TextBlock x:Uid="Windows_Color_Settings" />
|
<TextBlock x:Uid="Windows_Color_Settings" />
|
||||||
</HyperlinkButton>
|
</HyperlinkButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name"));
|
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OpenColorsSettings_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Helpers.StartProcessHelper.Start(Helpers.StartProcessHelper.ColorsSettings);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public Tuple<string, string> SelectedSearchResultPreference
|
public Tuple<string, string> SelectedSearchResultPreference
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
<RadioButton x:Uid="Radio_Theme_Light" />
|
<RadioButton x:Uid="Radio_Theme_Light" />
|
||||||
<RadioButton x:Uid="Radio_Theme_Default"/>
|
<RadioButton x:Uid="Radio_Theme_Default"/>
|
||||||
</muxc:RadioButtons>
|
</muxc:RadioButtons>
|
||||||
<HyperlinkButton NavigateUri="ms-settings:colors">
|
<HyperlinkButton Click="OpenColorsSettings_Click">
|
||||||
<TextBlock x:Uid="Windows_Color_Settings" />
|
<TextBlock x:Uid="Windows_Color_Settings" />
|
||||||
</HyperlinkButton>
|
</HyperlinkButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -21,5 +21,10 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
ViewModel = new ShortcutGuideViewModel(SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), SettingsRepository<ShortcutGuideSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage);
|
ViewModel = new ShortcutGuideViewModel(SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), SettingsRepository<ShortcutGuideSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage);
|
||||||
DataContext = ViewModel;
|
DataContext = ViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OpenColorsSettings_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Helpers.StartProcessHelper.Start(Helpers.StartProcessHelper.ColorsSettings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user