From b8c88840652df480281cbf0958e24543d379bd3b Mon Sep 17 00:00:00 2001 From: Jay <65828559+Jay-o-Way@users.noreply.github.com> Date: Wed, 21 Sep 2022 15:28:38 +0200 Subject: [PATCH] Settings: Fixing Checkbox margins (#20195) * Fixing margins as in issue #17110 * one more margin fixed The top of "Include in global result" * set resource-style to one control --- .../CheckBoxWithDescriptionControl.cs | 8 +- .../Settings.UI/Views/PowerLauncherPage.xaml | 88 +++++++++---------- 2 files changed, 44 insertions(+), 52 deletions(-) diff --git a/src/settings-ui/Settings.UI/Controls/CheckBoxWithDescriptionControl.cs b/src/settings-ui/Settings.UI/Controls/CheckBoxWithDescriptionControl.cs index 58b3db1063..84b1a3a075 100644 --- a/src/settings-ui/Settings.UI/Controls/CheckBoxWithDescriptionControl.cs +++ b/src/settings-ui/Settings.UI/Controls/CheckBoxWithDescriptionControl.cs @@ -36,16 +36,12 @@ namespace Microsoft.PowerToys.Settings.UI.Controls private void CheckBoxSubTextControl_Loaded(object sender, RoutedEventArgs e) { StackPanel panel = new StackPanel() { Orientation = Orientation.Vertical }; + panel.Children.Add(new TextBlock() { Text = Header, TextWrapping = TextWrapping.WrapWholeWords }); // Add text box only if the description is not empty. Required for additional plugin options. if (!string.IsNullOrWhiteSpace(Description)) { - panel.Children.Add(new TextBlock() { Margin = new Thickness(0, 10, 0, 0), Text = Header, TextWrapping = TextWrapping.WrapWholeWords }); - panel.Children.Add(new IsEnabledTextBlock() { Style = (Style)App.Current.Resources["SecondaryIsEnabledTextBlockStyle"], Text = Description }); - } - else - { - panel.Children.Add(new TextBlock() { Margin = new Thickness(0, 0, 0, 0), Text = Header, TextWrapping = TextWrapping.WrapWholeWords }); + panel.Children.Add(new IsEnabledTextBlock() { Style = (Style)App.Current.Resources["SecondaryIsEnabledTextBlockStyle"], Text = Description }); } _checkBoxSubTextControl.Content = panel; diff --git a/src/settings-ui/Settings.UI/Views/PowerLauncherPage.xaml b/src/settings-ui/Settings.UI/Views/PowerLauncherPage.xaml index a02348b10a..4614528615 100644 --- a/src/settings-ui/Settings.UI/Views/PowerLauncherPage.xaml +++ b/src/settings-ui/Settings.UI/Views/PowerLauncherPage.xaml @@ -45,8 +45,8 @@ + IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.UseCentralizedKeyboardHook}" + Margin="{StaticResource ExpanderSettingMargin}"/> + Maximum="500" + Value="{x:Bind Mode=TwoWay, Path=ViewModel.SearchInputDelayFast}" + MinWidth="{StaticResource SettingActionControlMinWidth}" + SpinButtonPlacementMode="Compact" + HorizontalAlignment="Left" + SmallChange="10" + LargeChange="50"/> + Maximum="1000" + Value="{x:Bind Mode=TwoWay, Path=ViewModel.SearchInputDelay}" + MinWidth="{StaticResource SettingActionControlMinWidth}" + SpinButtonPlacementMode="Compact" + HorizontalAlignment="Left" + SmallChange="10" + LargeChange="50"/> @@ -138,9 +138,9 @@ + MinWidth="{StaticResource SettingActionControlMinWidth}" + SpinButtonPlacementMode="Compact" + Minimum="1"/> @@ -162,13 +162,13 @@ + Maximum="1000" + Value="{x:Bind Mode=TwoWay, Path=ViewModel.SearchClickedItemWeight}" + MinWidth="{StaticResource SettingActionControlMinWidth}" + SpinButtonPlacementMode="Compact" + HorizontalAlignment="Left" + SmallChange="5" + LargeChange="50"/> @@ -181,11 +181,10 @@ --> - + Margin="{StaticResource ExpanderSettingMargin}" /> @@ -243,13 +242,13 @@ + Severity="Informational" + IsClosable="False" + IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}" + IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"> + x:Uid="Run_ConflictingKeywordInfo_Link"/> @@ -290,8 +289,8 @@ + Width="20" + Height="20" /> @@ -335,21 +334,20 @@ + Margin="{StaticResource ExpanderSettingMargin}"> + x:Uid="PowerLauncher_IncludeInGlobalResultTitle" /> + FontSize="{StaticResource SecondaryTextFontSize}" + Foreground="{ThemeResource TextFillColorSecondaryBrush}"/> + Style="{StaticResource ExpanderContentSettingStyleTight}" + IsEnabled="{x:Bind IsGlobalAndEnabled, Mode=OneWay}"> + IsChecked="{x:Bind Path=Value, Mode=TwoWay}" Margin="{StaticResource ExpanderSettingMargin}"/> -