[Fix] Correctly scales the rest of the utility when the user changes the font size (#3564)

This commit is contained in:
Jared Cervantes
2025-09-16 14:15:27 -04:00
committed by GitHub
parent 40b2894ed1
commit af7030d536
3 changed files with 182 additions and 137 deletions

View File

@@ -24,7 +24,9 @@ function Initialize-InstallCategoryAppList {
$toggleButton = New-Object Windows.Controls.Label $toggleButton = New-Object Windows.Controls.Label
$toggleButton.Content = "$Category" $toggleButton.Content = "$Category"
$toggleButton.Tag = "CategoryToggleButton" $toggleButton.Tag = "CategoryToggleButton"
$sync.$Category = $Category $toggleButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
$toggleButton.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily")
$sync.$Category = $toggleButton
$null = $TargetElement.Items.Add($toggleButton) $null = $TargetElement.Items.Add($toggleButton)
} }

View File

@@ -140,6 +140,7 @@ function Invoke-WPFUIElements {
$label.Content = $category -replace ".*__", "" $label.Content = $category -replace ".*__", ""
$label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize") $label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
$label.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily") $label.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily")
$label.UseLayoutRounding = $true
$itemsControl.Items.Add($label) | Out-Null $itemsControl.Items.Add($label) | Out-Null
$sync[$category] = $label $sync[$category] = $label
@@ -154,6 +155,7 @@ function Invoke-WPFUIElements {
$checkBox = New-Object Windows.Controls.CheckBox $checkBox = New-Object Windows.Controls.CheckBox
$checkBox.Name = $entryInfo.Name $checkBox.Name = $entryInfo.Name
$checkBox.HorizontalAlignment = "Right" $checkBox.HorizontalAlignment = "Right"
$checkBox.UseLayoutRounding = $true
$dockPanel.Children.Add($checkBox) | Out-Null $dockPanel.Children.Add($checkBox) | Out-Null
$checkBox.Style = $ColorfulToggleSwitchStyle $checkBox.Style = $ColorfulToggleSwitchStyle
@@ -163,6 +165,7 @@ function Invoke-WPFUIElements {
$label.HorizontalAlignment = "Left" $label.HorizontalAlignment = "Left"
$label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSize") $label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSize")
$label.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor") $label.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$label.UseLayoutRounding = $true
$dockPanel.Children.Add($label) | Out-Null $dockPanel.Children.Add($label) | Out-Null
$itemsControl.Items.Add($dockPanel) | Out-Null $itemsControl.Items.Add($dockPanel) | Out-Null
@@ -217,6 +220,7 @@ function Invoke-WPFUIElements {
$label.HorizontalAlignment = "Left" $label.HorizontalAlignment = "Left"
$label.VerticalAlignment = "Center" $label.VerticalAlignment = "Center"
$label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize") $label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
$label.UseLayoutRounding = $true
$horizontalStackPanel.Children.Add($label) | Out-Null $horizontalStackPanel.Children.Add($label) | Out-Null
$comboBox = New-Object Windows.Controls.ComboBox $comboBox = New-Object Windows.Controls.ComboBox
@@ -226,11 +230,14 @@ function Invoke-WPFUIElements {
$comboBox.HorizontalAlignment = "Left" $comboBox.HorizontalAlignment = "Left"
$comboBox.VerticalAlignment = "Center" $comboBox.VerticalAlignment = "Center"
$comboBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "ButtonMargin") $comboBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "ButtonMargin")
$comboBox.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
$comboBox.UseLayoutRounding = $true
foreach ($comboitem in ($entryInfo.ComboItems -split " ")) { foreach ($comboitem in ($entryInfo.ComboItems -split " ")) {
$comboBoxItem = New-Object Windows.Controls.ComboBoxItem $comboBoxItem = New-Object Windows.Controls.ComboBoxItem
$comboBoxItem.Content = $comboitem $comboBoxItem.Content = $comboitem
$comboBoxItem.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize") $comboBoxItem.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
$comboBoxItem.UseLayoutRounding = $true
$comboBox.Items.Add($comboBoxItem) | Out-Null $comboBox.Items.Add($comboBoxItem) | Out-Null
} }
@@ -239,6 +246,19 @@ function Invoke-WPFUIElements {
$comboBox.SelectedIndex = 0 $comboBox.SelectedIndex = 0
# Set initial text
if ($comboBox.Items.Count -gt 0) {
$comboBox.Text = $comboBox.Items[0].Content
}
# Add SelectionChanged event handler to update the text property
$comboBox.Add_SelectionChanged({
$selectedItem = $this.SelectedItem
if ($selectedItem) {
$this.Text = $selectedItem.Content
}
})
$sync[$entryInfo.Name] = $comboBox $sync[$entryInfo.Name] = $comboBox
} }
@@ -250,7 +270,8 @@ function Invoke-WPFUIElements {
$button.SetResourceReference([Windows.Controls.Control]::MarginProperty, "ButtonMargin") $button.SetResourceReference([Windows.Controls.Control]::MarginProperty, "ButtonMargin")
$button.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize") $button.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
if ($entryInfo.ButtonWidth) { if ($entryInfo.ButtonWidth) {
$button.Width = $entryInfo.ButtonWidth $baseWidth = [int]$entryInfo.ButtonWidth
$button.Width = [math]::Max($baseWidth, 350)
} }
$itemsControl.Items.Add($button) | Out-Null $itemsControl.Items.Add($button) | Out-Null
@@ -281,6 +302,7 @@ function Invoke-WPFUIElements {
$radioButton.SetResourceReference([Windows.Controls.Control]::MarginProperty, "CheckBoxMargin") $radioButton.SetResourceReference([Windows.Controls.Control]::MarginProperty, "CheckBoxMargin")
$radioButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize") $radioButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "ButtonFontSize")
$radioButton.ToolTip = $entryInfo.Description $radioButton.ToolTip = $entryInfo.Description
$radioButton.UseLayoutRounding = $true
if ($entryInfo.Checked -eq $true) { if ($entryInfo.Checked -eq $true) {
$radioButton.IsChecked = $true $radioButton.IsChecked = $true
@@ -301,6 +323,7 @@ function Invoke-WPFUIElements {
$checkBox.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSize") $checkBox.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSize")
$checkBox.ToolTip = $entryInfo.Description $checkBox.ToolTip = $entryInfo.Description
$checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "CheckBoxMargin") $checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "CheckBoxMargin")
$checkBox.UseLayoutRounding = $true
if ($entryInfo.Checked -eq $true) { if ($entryInfo.Checked -eq $true) {
$checkBox.IsChecked = $entryInfo.Checked $checkBox.IsChecked = $entryInfo.Checked
} }
@@ -312,6 +335,7 @@ function Invoke-WPFUIElements {
$textBlock.Text = "(?)" $textBlock.Text = "(?)"
$textBlock.ToolTip = $entryInfo.Link $textBlock.ToolTip = $entryInfo.Link
$textBlock.Style = $HoverTextBlockStyle $textBlock.Style = $HoverTextBlockStyle
$textBlock.UseLayoutRounding = $true
$horizontalStackPanel.Children.Add($textBlock) | Out-Null $horizontalStackPanel.Children.Add($textBlock) | Out-Null

View File

@@ -10,8 +10,8 @@
WindowStyle="None" WindowStyle="None"
Width="Auto" Width="Auto"
Height="Auto" Height="Auto"
MaxWidth="1380" MinWidth="800"
MaxHeight="800" MinHeight="600"
Title="WinUtil"> Title="WinUtil">
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" CornerRadius="10"/> <WindowChrome CaptionHeight="0" CornerRadius="10"/>
@@ -534,11 +534,18 @@
Height="{DynamicResource CheckBoxBulletDecoratorSize *0.85}" Height="{DynamicResource CheckBoxBulletDecoratorSize *0.85}"
Margin="2" Margin="2"
SnapsToDevicePixels="True"/> SnapsToDevicePixels="True"/>
<Path x:Name="CheckMark" <Viewbox x:Name="CheckMarkContainer"
Stroke="{DynamicResource ToggleButtonOnColor}" Width="{DynamicResource CheckBoxBulletDecoratorSize}"
StrokeThickness="2" Height="{DynamicResource CheckBoxBulletDecoratorSize}"
Data="M 0 5 L 5 10 L 12 0" HorizontalAlignment="Center"
Visibility="Collapsed"/> VerticalAlignment="Center"
Visibility="Collapsed">
<Path x:Name="CheckMark"
Stroke="{DynamicResource ToggleButtonOnColor}"
StrokeThickness="1.5"
Data="M 0 5 L 5 10 L 12 0"
Stretch="Uniform"/>
</Viewbox>
</Grid> </Grid>
</BulletDecorator.Bullet> </BulletDecorator.Bullet>
<ContentPresenter Margin="4,0,0,0" <ContentPresenter Margin="4,0,0,0"
@@ -549,7 +556,7 @@
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True"> <Trigger Property="IsChecked" Value="True">
<Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/> <Setter TargetName="CheckMarkContainer" Property="Visibility" Value="Visible"/>
</Trigger> </Trigger>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<!--Setter TargetName="Border" Property="Background" Value="{DynamicResource ButtonBackgroundPressedColor}"/--> <!--Setter TargetName="Border" Property="Background" Value="{DynamicResource ButtonBackgroundPressedColor}"/-->
@@ -569,22 +576,24 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="RadioButton"> <ControlTemplate TargetType="RadioButton">
<StackPanel Orientation="Horizontal" Margin="{DynamicResource CheckBoxMargin}"> <StackPanel Orientation="Horizontal" Margin="{DynamicResource CheckBoxMargin}">
<Grid Width="14" Height="14"> <Viewbox Width="{DynamicResource CheckBoxBulletDecoratorSize}" Height="{DynamicResource CheckBoxBulletDecoratorSize}">
<Ellipse x:Name="OuterCircle" <Grid Width="14" Height="14">
Stroke="{DynamicResource ToggleButtonOffColor}" <Ellipse x:Name="OuterCircle"
Fill="{DynamicResource ButtonBackgroundColor}" Stroke="{DynamicResource ToggleButtonOffColor}"
StrokeThickness="1" Fill="{DynamicResource ButtonBackgroundColor}"
Width="14" StrokeThickness="1"
Height="14" Width="14"
SnapsToDevicePixels="True"/> Height="14"
<Ellipse x:Name="InnerCircle" SnapsToDevicePixels="True"/>
Fill="{DynamicResource ToggleButtonOnColor}" <Ellipse x:Name="InnerCircle"
Width="8" Fill="{DynamicResource ToggleButtonOnColor}"
Height="8" Width="8"
Visibility="Collapsed" Height="8"
HorizontalAlignment="Center" Visibility="Collapsed"
VerticalAlignment="Center"/> HorizontalAlignment="Center"
</Grid> VerticalAlignment="Center"/>
</Grid>
</Viewbox>
<ContentPresenter Margin="4,0,0,0" <ContentPresenter Margin="4,0,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
RecognizesAccessKey="True"/> RecognizesAccessKey="True"/>
@@ -892,63 +901,69 @@
</Window.Resources> </Window.Resources>
<Grid Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Name="WPFMainGrid" Width="Auto" Height="Auto" HorizontalAlignment="Stretch"> <Grid Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Name="WPFMainGrid" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="{DynamicResource TabRowHeightInPixels}"/> <RowDefinition Height="Auto"/>
<RowDefinition Height=".9*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DockPanel Name="NavDockPanel" HorizontalAlignment="Stretch" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Row="0" Width="Auto"> <Grid Grid.Row="0" Background="{DynamicResource MainBackgroundColor}">
<StackPanel Name="NavLogoPanel" Orientation="Horizontal" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Margin="10,0,20,0"> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <!-- Navigation buttons -->
<ColumnDefinition Width="*"/> <!-- Search bar and buttons -->
</Grid.ColumnDefinitions>
<!-- Navigation Buttons Panel -->
<StackPanel Name="NavDockPanel" Orientation="Horizontal" Grid.Column="0" Margin="5,5,10,5">
<StackPanel Name="NavLogoPanel" Orientation="Horizontal" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Margin="10,0,20,0">
</StackPanel>
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonInstallBackgroundColor}" Foreground="white" FontWeight="Bold" Name="WPFTab1BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonInstallForegroundColor}" >
<Underline>I</Underline>nstall
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonTweaksBackgroundColor}" Foreground="{DynamicResource ButtonTweaksForegroundColor}" FontWeight="Bold" Name="WPFTab2BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonTweaksForegroundColor}">
<Underline>T</Underline>weaks
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonConfigBackgroundColor}" Foreground="{DynamicResource ButtonConfigForegroundColor}" FontWeight="Bold" Name="WPFTab3BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonConfigForegroundColor}">
<Underline>C</Underline>onfig
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonUpdatesBackgroundColor}" Foreground="{DynamicResource ButtonUpdatesForegroundColor}" FontWeight="Bold" Name="WPFTab4BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonUpdatesForegroundColor}">
<Underline>U</Underline>pdates
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonUpdatesBackgroundColor}" Foreground="{DynamicResource ButtonUpdatesForegroundColor}" FontWeight="Bold" Name="WPFTab5BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonUpdatesForegroundColor}">
<Underline>M</Underline>icroWin
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
</StackPanel> </StackPanel>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonInstallBackgroundColor}" Foreground="white" FontWeight="Bold" Name="WPFTab1BT"> <!-- Search Bar and Action Buttons -->
<ToggleButton.Content> <Grid Name="GridBesideNavDockPanel" Grid.Column="1" Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Height="Auto">
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonInstallForegroundColor}" >
<Underline>I</Underline>nstall
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonTweaksBackgroundColor}" Foreground="{DynamicResource ButtonTweaksForegroundColor}" FontWeight="Bold" Name="WPFTab2BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonTweaksForegroundColor}">
<Underline>T</Underline>weaks
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonConfigBackgroundColor}" Foreground="{DynamicResource ButtonConfigForegroundColor}" FontWeight="Bold" Name="WPFTab3BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonConfigForegroundColor}">
<Underline>C</Underline>onfig
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonUpdatesBackgroundColor}" Foreground="{DynamicResource ButtonUpdatesForegroundColor}" FontWeight="Bold" Name="WPFTab4BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonUpdatesForegroundColor}">
<Underline>U</Underline>pdates
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
Background="{DynamicResource ButtonUpdatesBackgroundColor}" Foreground="{DynamicResource ButtonUpdatesForegroundColor}" FontWeight="Bold" Name="WPFTab5BT">
<ToggleButton.Content>
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonUpdatesForegroundColor}">
<Underline>M</Underline>icroWin
</TextBlock>
</ToggleButton.Content>
</ToggleButton>
<Grid Name="GridBesideNavDockPanel" Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <!-- Main content area --> <ColumnDefinition Width="2*"/> <!-- Search bar area - priority space -->
<ColumnDefinition Width="Auto"/><!-- Space for options button --> <ColumnDefinition Width="Auto"/><!-- Buttons area -->
<ColumnDefinition Width="Auto"/><!-- Space for close button -->
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/><!-- Space for Font Scaling button-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- <!--
@@ -960,27 +975,28 @@
Consider using a Math Solver, will help in making Consider using a Math Solver, will help in making
development of these things much easier development of these things much easier
--> -->
<TextBox <Border Grid.Column="0" Margin="5,0,0,0" Width="{DynamicResource SearchBarWidth}" Height="{DynamicResource SearchBarHeight}" VerticalAlignment="Center" HorizontalAlignment="Left">
Grid.Column="0" <Grid>
Width="{DynamicResource SearchBarWidth}" <TextBox
Height="{DynamicResource SearchBarHeight}" Width="{DynamicResource SearchBarWidth}"
FontSize="{DynamicResource SearchBarTextBoxFontSize}" Height="{DynamicResource SearchBarHeight}"
VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="{DynamicResource SearchBarTextBoxFontSize}"
BorderThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left"
Name="SearchBar" BorderThickness="1"
Foreground="{DynamicResource MainForegroundColor}" Background="{DynamicResource MainBackgroundColor}" Name="SearchBar"
Padding="3,3,30,0" Foreground="{DynamicResource MainForegroundColor}" Background="{DynamicResource MainBackgroundColor}"
Margin="5,0,0,0" Padding="3,3,30,0"
ToolTip="Press Ctrl-F and type app name to filter application list below. Press Esc to reset the filter"> ToolTip="Press Ctrl-F and type app name to filter application list below. Press Esc to reset the filter">
</TextBox> </TextBox>
<TextBlock <TextBlock
Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right"
VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
FontFamily="Segoe MDL2 Assets" Foreground="{DynamicResource ButtonBackgroundSelectedColor}"
Foreground="{DynamicResource ButtonBackgroundSelectedColor}" FontSize="{DynamicResource IconFontSize}"
FontSize="{DynamicResource IconFontSize}" Margin="0,0,8,0" Width="Auto" Height="Auto">&#xE721;
Margin="180,0,0,0">&#xE721; </TextBlock>
</TextBlock> </Grid>
</Border>
<!-- <!--
TODO: TODO:
Make this ClearButton Positioning react to Make this ClearButton Positioning react to
@@ -992,23 +1008,25 @@
VerticalAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left"
Name="SearchBarClearButton" Name="SearchBarClearButton"
Style="{StaticResource SearchBarClearButtonStyle}" Style="{StaticResource SearchBarClearButtonStyle}"
Margin="210,0,0,0" Visibility="Collapsed"> Margin="213,0,0,0" Visibility="Collapsed">
</Button> </Button>
<Button Name="ThemeButton" <!-- Buttons Container -->
Style="{StaticResource HoverButtonStyle}" <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,5">
Grid.Column="2" BorderBrush="Transparent" <Button Name="ThemeButton"
Style="{StaticResource HoverButtonStyle}"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}" Background="{DynamicResource MainBackgroundColor}"
Foreground="{DynamicResource MainForegroundColor}" Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}" FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}" Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top" HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,5,5,0" Margin="0,0,2,0"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe MDL2 Assets"
Content="N/A" Content="N/A"
ToolTip="Change the Winutil UI Theme" ToolTip="Change the Winutil UI Theme"
/> />
<Popup Grid.Column="2" Name="ThemePopup" <Popup Name="ThemePopup"
IsOpen="False" IsOpen="False"
PlacementTarget="{Binding ElementName=ThemeButton}" Placement="Bottom" PlacementTarget="{Binding ElementName=ThemeButton}" Placement="Bottom"
HorizontalAlignment="Right" VerticalAlignment="Top"> HorizontalAlignment="Right" VerticalAlignment="Top">
@@ -1033,20 +1051,20 @@
</Border> </Border>
</Popup> </Popup>
<Button Name="FontScalingButton" <Button Name="FontScalingButton"
Style="{StaticResource HoverButtonStyle}" Style="{StaticResource HoverButtonStyle}"
Grid.Column="3" BorderBrush="Transparent" BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}" Background="{DynamicResource MainBackgroundColor}"
Foreground="{DynamicResource MainForegroundColor}" Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}" FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}" Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top" HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,5,5,0" Margin="0,0,2,0"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe MDL2 Assets"
Content="&#xE8D3;" Content="&#xE8D3;"
ToolTip="Adjust Font Scaling for Accessibility" ToolTip="Adjust Font Scaling for Accessibility"
/> />
<Popup Grid.Column="3" Name="FontScalingPopup" <Popup Name="FontScalingPopup"
IsOpen="False" IsOpen="False"
PlacementTarget="{Binding ElementName=FontScalingButton}" Placement="Bottom" PlacementTarget="{Binding ElementName=FontScalingButton}" Placement="Bottom"
HorizontalAlignment="Right" VerticalAlignment="Top"> HorizontalAlignment="Right" VerticalAlignment="Top">
@@ -1101,18 +1119,18 @@
</Border> </Border>
</Popup> </Popup>
<Button Name="SettingsButton" <Button Name="SettingsButton"
Style="{StaticResource HoverButtonStyle}" Style="{StaticResource HoverButtonStyle}"
Grid.Column="4" BorderBrush="Transparent" BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}" Background="{DynamicResource MainBackgroundColor}"
Foreground="{DynamicResource MainForegroundColor}" Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}" FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}" Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top" HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="5,5,5,0" Margin="0,0,2,0"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe MDL2 Assets"
Content="&#xE713;"/> Content="&#xE713;"/>
<Popup Grid.Column="3" Name="SettingsPopup" <Popup Name="SettingsPopup"
IsOpen="False" IsOpen="False"
PlacementTarget="{Binding ElementName=SettingsButton}" Placement="Bottom" PlacementTarget="{Binding ElementName=SettingsButton}" Placement="Bottom"
HorizontalAlignment="Right" VerticalAlignment="Top"> HorizontalAlignment="Right" VerticalAlignment="Top">
@@ -1135,19 +1153,18 @@
</Border> </Border>
</Popup> </Popup>
<Button <Button
Grid.Column="5" Content="&#xD7;" BorderThickness="0"
Content="&#xD7;" BorderThickness="0"
BorderBrush="Transparent" BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}" Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}" Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top" HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,5,5,0" Margin="0,0,0,0"
FontFamily="{DynamicResource FontFamily}" FontFamily="{DynamicResource FontFamily}"
Foreground="{DynamicResource MainForegroundColor}" FontSize="{DynamicResource CloseIconFontSize}" Name="WPFCloseButton" /> Foreground="{DynamicResource MainForegroundColor}" FontSize="{DynamicResource CloseIconFontSize}" Name="WPFCloseButton" />
</StackPanel>
</Grid> </Grid>
</Grid>
</DockPanel>
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1"> <TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
<TabItem Header="Install" Visibility="Collapsed" Name="WPFTab1"> <TabItem Header="Install" Visibility="Collapsed" Name="WPFTab1">
@@ -1155,7 +1172,7 @@
<Grid Grid.Row="0" Grid.Column="0" Margin="{DynamicResource TabContentMargin}"> <Grid Grid.Row="0" Grid.Column="0" Margin="{DynamicResource TabContentMargin}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="225" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -1175,20 +1192,22 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0" Margin="{DynamicResource TabContentMargin}"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Grid.Row="0" Margin="{DynamicResource TabContentMargin}">
<Grid Background="Transparent"> <Grid Background="Transparent">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="45px"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Background="{DynamicResource MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5"> <StackPanel Background="{DynamicResource MainBackgroundColor}" Orientation="Vertical" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5">
<Label Content="Recommended Selections:" FontSize="{DynamicResource FontSize}" VerticalAlignment="Center" Margin="2"/> <Label Content="Recommended Selections:" FontSize="{DynamicResource FontSize}" VerticalAlignment="Center" Margin="2"/>
<Button Name="WPFstandard" Content=" Standard " Margin="2"/> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,2,0,0">
<Button Name="WPFminimal" Content=" Minimal " Margin="2"/> <Button Name="WPFstandard" Content=" Standard " Margin="2" Width="{DynamicResource ButtonWidth}" Height="{DynamicResource ButtonHeight}"/>
<Button Name="WPFClearTweaksSelection" Content=" Clear " Margin="2"/> <Button Name="WPFminimal" Content=" Minimal " Margin="2" Width="{DynamicResource ButtonWidth}" Height="{DynamicResource ButtonHeight}"/>
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/> <Button Name="WPFClearTweaksSelection" Content=" Clear " Margin="2" Width="{DynamicResource ButtonWidth}" Height="{DynamicResource ButtonHeight}"/>
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2" Width="{DynamicResource ButtonWidth}" Height="{DynamicResource ButtonHeight}"/>
</StackPanel>
</StackPanel> </StackPanel>
<Grid Name="tweakspanel" Grid.Row="1"> <Grid Name="tweakspanel" Grid.Row="1">
@@ -1206,22 +1225,22 @@
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
<Border Grid.Row="1" Background="{DynamicResource MainBackgroundColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" Padding="10"> <Border Grid.Row="1" Background="{DynamicResource MainBackgroundColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" Padding="10">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0"> <WrapPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0">
<Button Name="WPFTweaksbutton" Content="Run Tweaks" Margin="5"/> <Button Name="WPFTweaksbutton" Content="Run Tweaks" Margin="5" Width="{DynamicResource ButtonWidth}" Height="{DynamicResource ButtonHeight}"/>
<Button Name="WPFUndoall" Content="Undo Selected Tweaks" Margin="5"/> <Button Name="WPFUndoall" Content="Undo Selected Tweaks" Margin="5" Width="{DynamicResource ButtonWidth}" Height="{DynamicResource ButtonHeight}"/>
</StackPanel> </WrapPanel>
</Border> </Border>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3"> <TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}">
<Grid Name="featurespanel" Grid.Row="1" Background="Transparent"> <Grid Name="featurespanel" Grid.Row="1" Background="Transparent">
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4"> <TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="{DynamicResource TabContentMargin}">
<Grid Background="Transparent"> <Grid Background="Transparent" MaxWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Row for the 3 columns --> <RowDefinition Height="Auto"/> <!-- Row for the 3 columns -->
<RowDefinition Height="Auto"/> <!-- Row for Windows Version --> <RowDefinition Height="Auto"/> <!-- Row for Windows Version -->
@@ -1316,8 +1335,8 @@
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5"> <TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="{DynamicResource TabContentMargin}">
<Grid Width="Auto" Height="Auto"> <Grid MaxWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ScrollViewer}}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="3*"/> <ColumnDefinition Width="3*"/>