Skip to content

Commit 3385d1d

Browse files
[Settings] UX fixes (#45513)
## Summary of the Pull Request This PR includes: - UI improvements to the Mouse Without Borders settings page. - UI improvements to the AOT settings page. - Multiple small fixes (e.g. to enable proper disabled states) - Using GH Copilot CLI to loc strings that were hardcoded. - Using GH Copilot CLI to remove dead loc strings from `Resources.resw` (@Jay-o-Way will appreciated this 😁): <img width="606" height="245" alt="image" src="https://github.com/user-attachments/assets/aeab1201-1129-4ac9-a714-ac5ea7a227cc" /> ## PR Checklist - [x] Closes: #41688 - [x] Closes: #32869 - [x] Closes: #36200 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Jiří Polášek <[email protected]>
1 parent 2440f8f commit 3385d1d

17 files changed

+316
-823
lines changed

src/settings-ui/Settings.UI/SettingsXAML/App.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@
7676

7777
<Style BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="controls:CheckBoxWithDescriptionControl" />
7878

79+
<tkcontrols:MarkdownThemes
80+
x:Key="DescriptionTextMarkdownThemeConfig"
81+
InlineCodeBackground="{StaticResource ControlFillColorDefaultBrush}"
82+
InlineCodeBorderBrush="{StaticResource ControlElevationBorderBrush}"
83+
InlineCodeCornerRadius="2"
84+
InlineCodeFontSize="12"
85+
InlineCodeForeground="{StaticResource TextFillColorSecondaryBrush}"
86+
InlineCodePadding="2,0,2,1" />
87+
88+
<tkcontrols:MarkdownConfig x:Key="DescriptionTextMarkdownConfig" Themes="{StaticResource DescriptionTextMarkdownThemeConfig}" />
89+
7990
<TransitionCollection x:Key="SettingsCardsAnimations">
8091
<EntranceThemeTransition FromVerticalOffset="50" />
8192
<!-- Animates cards when loaded -->

src/settings-ui/Settings.UI/SettingsXAML/Controls/CheckBoxWithDescriptionControl.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
1212
{
1313
public partial class CheckBoxWithDescriptionControl : CheckBox
1414
{
15-
private CheckBoxWithDescriptionControl _checkBoxSubTextControl;
16-
1715
public CheckBoxWithDescriptionControl()
1816
{
19-
_checkBoxSubTextControl = (CheckBoxWithDescriptionControl)this;
2017
this.Loaded += CheckBoxSubTextControl_Loaded;
2118
}
2219

@@ -45,17 +42,17 @@ private void CheckBoxSubTextControl_Loaded(object sender, RoutedEventArgs e)
4542
panel.Children.Add(new IsEnabledTextBlock() { Style = (Style)App.Current.Resources["SecondaryIsEnabledTextBlockStyle"], Text = Description });
4643
}
4744

48-
_checkBoxSubTextControl.Content = panel;
45+
this.Content = panel;
4946
}
5047

5148
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
52-
"Header",
49+
nameof(Header),
5350
typeof(string),
5451
typeof(CheckBoxWithDescriptionControl),
5552
new PropertyMetadata(default(string)));
5653

5754
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(
58-
"Description",
55+
nameof(Description),
5956
typeof(string),
6057
typeof(CheckBoxWithDescriptionControl),
6158
new PropertyMetadata(default(string)));

src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@
100100
Keys="{x:Bind Hotkey.GetKeysList()}"
101101
LabelPlacement="Before" />
102102
<CheckBox
103+
x:Uid="ShortcutConflictWindow_IgnoreShortcut"
103104
HorizontalAlignment="Right"
104105
VerticalAlignment="Center"
105106
Click="OnIgnoreConflictClicked"
106-
Content="Ignore shortcut"
107107
IsChecked="{x:Bind ConflictIgnored, Mode=OneWay}" />
108108
</Grid>
109109

src/settings-ui/Settings.UI/SettingsXAML/Controls/IsEnabledTextBlock.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls">
55

6+
<Style BasedOn="{StaticResource DefaultIsEnabledTextBlockStyle}" TargetType="controls:IsEnabledTextBlock" />
7+
68
<Style x:Key="DefaultIsEnabledTextBlockStyle" TargetType="controls:IsEnabledTextBlock">
79
<Setter Property="Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
810
<Setter Property="IsTabStop" Value="False" />
@@ -16,6 +18,7 @@
1618
FontSize="{TemplateBinding FontSize}"
1719
FontWeight="{TemplateBinding FontWeight}"
1820
Foreground="{TemplateBinding Foreground}"
21+
IsTextSelectionEnabled="{TemplateBinding IsTextSelectionEnabled}"
1922
Text="{TemplateBinding Text}"
2023
TextWrapping="WrapWholeWords" />
2124
<VisualStateManager.VisualStateGroups>

src/settings-ui/Settings.UI/SettingsXAML/Controls/IsEnabledTextBlock.xaml.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public partial class IsEnabledTextBlock : Control
1515
{
1616
public IsEnabledTextBlock()
1717
{
18-
this.Style = (Style)App.Current.Resources["DefaultIsEnabledTextBlockStyle"];
18+
this.DefaultStyleKey = typeof(KeyVisual);
1919
}
2020

2121
protected override void OnApplyTemplate()
@@ -26,11 +26,7 @@ protected override void OnApplyTemplate()
2626
base.OnApplyTemplate();
2727
}
2828

29-
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
30-
"Text",
31-
typeof(string),
32-
typeof(IsEnabledTextBlock),
33-
null);
29+
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(nameof(Text), typeof(string), typeof(IsEnabledTextBlock), new PropertyMetadata(null));
3430

3531
[Localizable(true)]
3632
public string Text
@@ -39,6 +35,14 @@ public string Text
3935
set => SetValue(TextProperty, value);
4036
}
4137

38+
public static readonly DependencyProperty IsTextSelectionEnabledProperty = DependencyProperty.Register(nameof(IsTextSelectionEnabled), typeof(bool), typeof(IsEnabledTextBlock), new PropertyMetadata(false));
39+
40+
public bool IsTextSelectionEnabled
41+
{
42+
get => (bool)GetValue(IsTextSelectionEnabledProperty);
43+
set => SetValue(IsTextSelectionEnabledProperty, value);
44+
}
45+
4246
private void IsEnabledTextBlock_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
4347
{
4448
SetEnabledState();

src/settings-ui/Settings.UI/SettingsXAML/Controls/ModelPicker/FoundryLocalModelPicker.xaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,9 @@
3939
Grid.Row="1"
4040
Padding="4"
4141
IsClosable="False"
42-
IsOpen="True"
43-
Message="Foundry Local is still in Public Preview">
42+
IsOpen="True">
4443
<InfoBar.ActionButton>
45-
<HyperlinkButton
46-
x:Uid="AdvancedPaste_FL_LearnMoreFoundryLocal"
47-
Content="Learn more"
48-
NavigateUri="https://learn.microsoft.com/azure/ai-foundry/foundry-local/what-is-foundry-local" />
44+
<HyperlinkButton x:Uid="AdvancedPaste_FL_LearnMoreFoundryLocal" NavigateUri="https://learn.microsoft.com/azure/ai-foundry/foundry-local/what-is-foundry-local" />
4945
</InfoBar.ActionButton>
5046
</InfoBar>
5147
<StackPanel

src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeOverviewAlternate.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
Grid.Row="2"
136136
FontSize="12"
137137
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
138-
Text="To pick a color:"
139138
TextWrapping="Wrap" />
140139
<controls:ShortcutWithTextLabelControl
141140
x:Name="ColorPickerHotkeyControl"

src/settings-ui/Settings.UI/SettingsXAML/Views/AdvancedPastePage.xaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
</tkcontrols:SettingsExpander.Description>
105105
<tkcontrols:SettingsExpander.ItemsHeader>
106106
<tkcontrols:SettingsCard x:Uid="AdvancedPaste_ModelProviders" Style="{StaticResource DefaultSettingsExpanderItemStyle}">
107-
<Button Content="Add model" Style="{StaticResource AccentButtonStyle}">
107+
<Button x:Uid="AdvancedPaste_AddModelButton" Style="{StaticResource AccentButtonStyle}">
108108
<Button.Flyout>
109109
<MenuFlyout x:Name="AddProviderMenuFlyout" Opening="AddProviderMenuFlyout_Opening" />
110110
</Button.Flyout>
@@ -431,7 +431,6 @@
431431
<ContentDialog
432432
x:Name="PasteAIProviderConfigurationDialog"
433433
x:Uid="AdvancedPaste_EndpointDialog"
434-
Title="Paste with AI provider configuration"
435434
Closed="PasteAIProviderConfigurationDialog_Closed"
436435
PrimaryButtonClick="PasteAIProviderConfigurationDialog_PrimaryButtonClick"
437436
PrimaryButtonStyle="{ThemeResource AccentButtonStyle}">
@@ -533,7 +532,6 @@
533532
MinHeight="76"
534533
HorizontalAlignment="Stretch"
535534
AcceptsReturn="True"
536-
Header="System prompt"
537535
Text="{x:Bind ViewModel.PasteAIProviderDraft.SystemPrompt, Mode=TwoWay}"
538536
TextWrapping="Wrap" />
539537
<Grid
@@ -549,9 +547,9 @@
549547
Spacing="8">
550548
<TextBox
551549
x:Name="PasteAIModelPathTextBox"
550+
x:Uid="AdvancedPaste_ModelPath"
552551
MinWidth="200"
553552
HorizontalAlignment="Stretch"
554-
Header="Model path"
555553
PlaceholderText="C:\Models\phi-3.onnx"
556554
Text="{x:Bind ViewModel.PasteAIProviderDraft.ModelPath, Mode=TwoWay}" />
557555
<Button

src/settings-ui/Settings.UI/SettingsXAML/Views/AlwaysOnTopPage.xaml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xmlns:ui="using:CommunityToolkit.WinUI"
1111
AutomationProperties.LandmarkType="Main"
1212
mc:Ignorable="d">
13-
13+
<local:NavigablePage.Resources />
1414
<controls:SettingsPageControl
1515
x:Uid="AlwaysOnTop"
1616
IsTabStop="False"
@@ -38,24 +38,7 @@
3838
</tkcontrols:SettingsCard>
3939
</tkcontrols:SettingsExpander.Items>
4040
</tkcontrols:SettingsExpander>
41-
<tkcontrols:SettingsExpander
42-
x:Uid="AlwaysOnTop_TransparencyInfo"
43-
HeaderIcon="{ui:FontIcon Glyph=&#xE790;}"
44-
IsExpanded="True">
45-
<tkcontrols:SettingsExpander.Items>
46-
<tkcontrols:SettingsCard ContentAlignment="Left">
47-
<controls:ShortcutWithTextLabelControl x:Uid="AlwaysOnTop_IncreaseOpacity" Keys="{x:Bind ViewModel.IncreaseOpacityKeysList, Mode=OneWay}" />
48-
</tkcontrols:SettingsCard>
49-
<tkcontrols:SettingsCard ContentAlignment="Left">
50-
<controls:ShortcutWithTextLabelControl x:Uid="AlwaysOnTop_DecreaseOpacity" Keys="{x:Bind ViewModel.DecreaseOpacityKeysList, Mode=OneWay}" />
51-
</tkcontrols:SettingsCard>
52-
<tkcontrols:SettingsCard>
53-
<tkcontrols:SettingsCard.Description>
54-
<TextBlock x:Uid="AlwaysOnTop_TransparencyRange" Style="{StaticResource SecondaryTextStyle}" />
55-
</tkcontrols:SettingsCard.Description>
56-
</tkcontrols:SettingsCard>
57-
</tkcontrols:SettingsExpander.Items>
58-
</tkcontrols:SettingsExpander>
41+
5942
</controls:SettingsGroup>
6043

6144
<controls:SettingsGroup x:Uid="AlwaysOnTop_Behavior_GroupSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
@@ -113,6 +96,22 @@
11396
<tkcontrols:SettingsCard x:Uid="AlwaysOnTop_Sound" HeaderIcon="{ui:FontIcon Glyph=&#xE7F3;}">
11497
<ToggleSwitch IsOn="{x:Bind ViewModel.SoundEnabled, Mode=TwoWay}" />
11598
</tkcontrols:SettingsCard>
99+
100+
<tkcontrols:SettingsExpander
101+
x:Uid="AlwaysOnTop_TransparencyInfo"
102+
HeaderIcon="{ui:FontIcon Glyph=&#xE790;}"
103+
IsExpanded="True">
104+
<tkcontrols:SettingsExpander.Items>
105+
<tkcontrols:SettingsCard>
106+
<tkcontrols:SettingsCard.Description>
107+
<StackPanel Orientation="Vertical">
108+
<tkcontrols:MarkdownTextBlock Config="{StaticResource DescriptionTextMarkdownConfig}" Text="{x:Bind ViewModel.IncreaseOpacityShortcut, Mode=OneWay}" />
109+
<tkcontrols:MarkdownTextBlock Config="{StaticResource DescriptionTextMarkdownConfig}" Text="{x:Bind ViewModel.DecreaseOpacityShortcut, Mode=OneWay}" />
110+
</StackPanel>
111+
</tkcontrols:SettingsCard.Description>
112+
</tkcontrols:SettingsCard>
113+
</tkcontrols:SettingsExpander.Items>
114+
</tkcontrols:SettingsExpander>
116115
</controls:SettingsGroup>
117116

118117
<controls:SettingsGroup x:Uid="ExcludedApps" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">

src/settings-ui/Settings.UI/SettingsXAML/Views/CmdPalPage.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
Source="/Assets/Settings/Modules/CmdPal_Background.png"
5353
Stretch="UniformToFill" />
5454
<TextBlock
55+
x:Uid="CmdPal_HeroTitle"
5556
Margin="0,24,0,12"
5657
HorizontalAlignment="Center"
5758
FontSize="36"
58-
FontWeight="Bold"
59-
Text="Command Palette">
59+
FontWeight="Bold">
6060
<TextBlock.Foreground>
6161
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
6262
<GradientStop Offset="0.0" Color="#FFB9EBFF" />
@@ -171,7 +171,6 @@
171171
Grid.Row="3"
172172
ActionIcon="{ui:FontIcon Glyph=&#xE8A7;}"
173173
Click="LaunchCard_Click"
174-
Header="Launch Command Palette"
175174
HeaderIcon="{ui:FontIcon Glyph=&#xE945;}"
176175
IsClickEnabled="True"
177176
IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">

0 commit comments

Comments
 (0)