Merge branch 'master' into users/niels9001/settings-accesbilitynarratorsupportforshortcutcontrol

This commit is contained in:
Niels Laute
2020-10-24 15:45:36 +02:00
85 changed files with 808 additions and 27540 deletions

View File

@@ -51,6 +51,7 @@
<ItemGroup>
<ProjectReference Include="..\..\common\interop\interop.vcxproj" />
<ProjectReference Include="..\..\common\ManagedCommon\ManagedCommon.csproj" />
<ProjectReference Include="..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj" />
</ItemGroup>

View File

@@ -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;
}
}
}

View File

@@ -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

View File

@@ -204,10 +204,10 @@
<value>Current Shortcut Remappings</value>
</data>
<data name="KeyboardManager_RemappedKeysListItem.AutomationProperties.Name" xml:space="preserve">
<value>Key remapping</value>
<value>Key Remapping</value>
</data>
<data name="KeyboardManager_RemappedShortcutsListItem.AutomationProperties.Name" xml:space="preserve">
<value>Shortcut remapping</value>
<value>Shortcut Remapping</value>
</data>
<data name="KeyboardManager_RemappedTo.AutomationProperties.Name" xml:space="preserve">
<value>Remapped to</value>
@@ -302,6 +302,9 @@
<data name="PowerLauncher_ClearInputOnLaunch.Content" xml:space="preserve">
<value>Clear the previous query on launch</value>
</data>
<data name="PowerLauncher_Theme.Text" xml:space="preserve">
<value>Choose color</value>
</data>
<data name="KeyboardManager_KeysMappingLayoutRightHeader.Text" xml:space="preserve">
<value>To:</value>
<comment>Keyboard Manager mapping keys view right header</comment>
@@ -337,7 +340,7 @@
<value>Open zones editor</value>
</data>
<data name="SettingsPage_SetShortcut.AutomationProperties.Name" xml:space="preserve">
<value>Shortcut setting</value>
<value>Set Shortcut</value>
</data>
<data name="SettingsPage_SetShortcut_Glyph.AutomationProperties.Name" xml:space="preserve">
<value>Information Symbol</value>
@@ -502,7 +505,7 @@
<value>Enable Image Resizer</value>
</data>
<data name="ImagesSizesListView.AutomationProperties.Name" xml:space="preserve">
<value>Image size</value>
<value>Image Size</value>
</data>
<data name="ImageResizer_Configurations.AutomationProperties.Name" xml:space="preserve">
<value>Configurations</value>
@@ -511,19 +514,19 @@
<value>Configuration Name</value>
</data>
<data name="ImageResizer_Fit_Property.AutomationProperties.Name" xml:space="preserve">
<value>Fit property</value>
<value>Fit Property</value>
</data>
<data name="ImageResizer_Width_Property.AutomationProperties.Name" xml:space="preserve">
<value>Width property</value>
<value>Width Property</value>
</data>
<data name="ImageResizer_Height_Property.AutomationProperties.Name" xml:space="preserve">
<value>Height Property</value>
</data>
<data name="ImageResizer_Size_Property.AutomationProperties.Name" xml:space="preserve">
<value>Size property</value>
<value>Size Property</value>
</data>
<data name="ImageResizer_Times_Symbol.AutomationProperties.Name" xml:space="preserve">
<value>Times symbol</value>
<value>Times Symbol</value>
</data>
<data name="RemoveButton.AutomationProperties.Name" xml:space="preserve">
<value>Remove</value>
@@ -774,4 +777,16 @@
<data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve">
<value>Example: %1 (%2)</value>
</data>
<data name="PowerLauncher_Radio_Theme_Dark.Content" xml:space="preserve">
<value>Dark</value>
</data>
<data name="PowerLauncher_Radio_Theme_Default.Content" xml:space="preserve">
<value>System default</value>
</data>
<data name="PowerLauncher_Radio_Theme_Light.Content" xml:space="preserve">
<value>Light</value>
</data>
<data name="SettingsPage_SetShortcut.AutomationProperties.Name" xml:space="preserve">
<value>Set Shortcut</value> <value>Shortcut setting</value>
</data> </data>
</root>

View File

@@ -22,6 +22,7 @@
<Style x:Key="SettingsGroupTitleStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">
<Setter Property="Margin" Value="0,34,0,4" />
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="AutomationProperties.HeadingLevel" Value="Level2" />
</Style>
<Style x:Key="SettingsGroupTitleStyleAsHeader" TargetType="TextBlock" BasedOn="{StaticResource SettingsGroupTitleStyle}">

View File

@@ -54,6 +54,7 @@
<TextBlock x:Uid="Admin_Mode"
FontWeight="SemiBold"
TextWrapping="Wrap"
AutomationProperties.HeadingLevel="Level2"
Style="{StaticResource SubtitleTextBlockStyle}"/>
<TextBlock Text="{x:Bind Mode=TwoWay, Path=ViewModel.RunningAsText}"

View File

@@ -143,7 +143,22 @@
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.DisableDriveDetectionWarning}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
/>
<TextBlock x:Uid="Appearance_GroupSettings"
Style="{StaticResource SettingsGroupTitleStyle}"
Foreground="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher, Converter={StaticResource ModuleEnabledToForegroundConverter}}" />
<TextBlock x:Uid="PowerLauncher_Theme"
Margin="{StaticResource SmallTopMargin}"
Foreground="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher, Converter={StaticResource ModuleEnabledToForegroundConverter}}" />
<muxc:RadioButtons IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}">
<RadioButton x:Uid="PowerLauncher_Radio_Theme_Dark"
IsChecked="{Binding Mode=TwoWay, Path=IsDarkThemeRadioButtonChecked}" />
<RadioButton x:Uid="PowerLauncher_Radio_Theme_Light"
IsChecked="{Binding Mode=TwoWay, Path=IsLightThemeRadioButtonChecked}" />
<RadioButton x:Uid="PowerLauncher_Radio_Theme_Default"
IsChecked="{Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}" />
</muxc:RadioButtons>
</StackPanel>
<RelativePanel x:Name="SidePanel"

View File

@@ -29,61 +29,61 @@
CompactModeThresholdWidth="0"
Background="{ThemeResource SystemControlBackgroundAltHighBrush}">
<winui:NavigationView.MenuItems>
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage">
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xE713;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<winui:NavigationViewItem x:Uid="Shell_ColorPicker" helpers:NavHelper.NavigateTo="views:ColorPickerPage">
<winui:NavigationViewItem x:Uid="Shell_ColorPicker" helpers:NavHelper.NavigateTo="views:ColorPickerPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xEF3C;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<!-- TO DO: Update icon -->
<winui:NavigationViewItem x:Uid="Shell_FancyZones" helpers:NavHelper.NavigateTo="views:FancyZonesPage">
<winui:NavigationViewItem x:Uid="Shell_FancyZones" helpers:NavHelper.NavigateTo="views:FancyZonesPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<PathIcon Data="M896 0v896H0V0h896zM768 768V128H128v640h640zM0 1920v-896h1920v896H0zm128-768v640h1664v-640H128zM1024 0h896v896h-896V0zm768 768V128h-640v640h640z"></PathIcon>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<winui:NavigationViewItem x:Uid="Shell_PowerPreview" helpers:NavHelper.NavigateTo="views:PowerPreviewPage" >
<winui:NavigationViewItem x:Uid="Shell_PowerPreview" helpers:NavHelper.NavigateTo="views:PowerPreviewPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xEC50;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<!-- TO DO: Update icon -->
<winui:NavigationViewItem x:Uid="Shell_ImageResizer" helpers:NavHelper.NavigateTo="views:ImageResizerPage">
<winui:NavigationViewItem x:Uid="Shell_ImageResizer" helpers:NavHelper.NavigateTo="views:ImageResizerPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<PathIcon Data="M0 768h1408v1152H0V768zm128 1024h870l-582-581-288 288v293zm1152 0v-102l-224-223-101 101 223 224h102zM128 896v421l288-287 448 447 192-191 224 224V896H128zm832 256q-26 0-45-19t-19-45q0-26 19-45t45-19q26 0 45 19t19 45q0 26-19 45t-45 19zm960-512V347l-339 338-90-90 338-339h-293V128h512v512h-128zm-768-512h256v128h-256V128zm-128 128H768V128h256v128zm-384 0H384V128h256v128zm-384 0H0V128h256v128zM128 640H0V384h128v256zm1920 128v256h-128V768h128zm-128 384h128v256h-128v-256zm0 384h128v256h-128v-256zm-384 256h256v128h-256v-128z"></PathIcon>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<!-- TO DO: Update icon -->
<winui:NavigationViewItem x:Uid="Shell_KeyboardManager" helpers:NavHelper.NavigateTo="views:KeyboardManagerPage">
<winui:NavigationViewItem x:Uid="Shell_KeyboardManager" helpers:NavHelper.NavigateTo="views:KeyboardManagerPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xE765;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<!-- TO DO: Update icon -->
<winui:NavigationViewItem x:Uid="Shell_PowerRename" helpers:NavHelper.NavigateTo="views:PowerRenamePage">
<winui:NavigationViewItem x:Uid="Shell_PowerRename" helpers:NavHelper.NavigateTo="views:PowerRenamePage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xE8AC;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<!-- TO DO: Update icon -->
<winui:NavigationViewItem x:Uid="Shell_PowerLauncher" helpers:NavHelper.NavigateTo="views:PowerLauncherPage">
<winui:NavigationViewItem x:Uid="Shell_PowerLauncher" helpers:NavHelper.NavigateTo="views:PowerLauncherPage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xE773;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<!-- TO DO: Update icon -->
<winui:NavigationViewItem x:Uid="Shell_ShortcutGuide" helpers:NavHelper.NavigateTo="views:ShortcutGuidePage">
<winui:NavigationViewItem x:Uid="Shell_ShortcutGuide" helpers:NavHelper.NavigateTo="views:ShortcutGuidePage" AutomationProperties.HeadingLevel="Level1">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xEDA7;"/>
</winui:NavigationViewItem.Icon>
@@ -100,7 +100,8 @@
Text="{Binding}"
FontWeight="Bold"
Style="{ThemeResource TitleTextBlockStyle}"
Margin="{StaticResource SmallLeftRightMargin}" />
Margin="{StaticResource SmallLeftRightMargin}"
AutomationProperties.HeadingLevel="Level1" />
</Grid>
</DataTemplate>
</behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>