Add maximaze button (#4841)

* Add maximize button logic and update assets

* Add maximize button with theming

* delelte logo

* Center and restyle the window control buttons

* Fix window state test setup

---------

Co-authored-by: aran628 <aran2014+@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
aran628
2026-07-15 16:59:51 -05:00
committed by GitHub
co-authored by aran628 Chris Titus
parent 822003d87f
commit 13a18eeeb2
5 changed files with 161 additions and 23 deletions
+59 -21
View File
@@ -955,7 +955,7 @@
</Grid.ColumnDefinitions>
<!-- Navigation Buttons Panel -->
<StackPanel Name="NavDockPanel" Orientation="Horizontal" Grid.Column="0" Margin="5,5,10,5">
<StackPanel Name="NavDockPanel" Orientation="Horizontal" Grid.Column="0" VerticalAlignment="Center" 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}"
@@ -1037,7 +1037,7 @@
</Button>
<!-- Buttons Container -->
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,5">
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,5,5,5">
<Button Name="ThemeButton"
Style="{StaticResource HoverButtonStyle}"
BorderBrush="Transparent"
@@ -1045,7 +1045,7 @@
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,2,0"
FontFamily="Segoe MDL2 Assets"
Content="N/A"
@@ -1083,7 +1083,7 @@
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,2,0"
FontFamily="Segoe MDL2 Assets"
Content="&#xE8D3;"
@@ -1151,7 +1151,7 @@
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,2,0"
FontFamily="Segoe MDL2 Assets"
Content="&#xE713;"/>
@@ -1180,24 +1180,62 @@
</Popup>
<Button
Content="&#x2212;" BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,0,0,0"
FontFamily="{DynamicResource FontFamily}"
Foreground="{DynamicResource MainForegroundColor}" FontSize="{DynamicResource CloseIconFontSize}" Name="WPFMinimizeButton" />
Content="&#xE921;"
Style="{StaticResource HoverButtonStyle}"
BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0"
FontFamily="Segoe MDL2 Assets"
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource CloseIconFontSize}"
ToolTip="Minimize"
AutomationProperties.Name="Minimize"
Name="WPFMinimizeButton" />
<Button
BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,0,0"
FontFamily="Segoe MDL2 Assets"
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource CloseIconFontSize}"
Name="WPFMaximizeButton">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource HoverButtonStyle}">
<Setter Property="Content" Value="&#xE922;"/>
<Setter Property="ToolTip" Value="Maximize"/>
<Setter Property="AutomationProperties.Name" Value="Maximize"/>
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" Value="Maximized">
<Setter Property="Content" Value="&#xE923;"/>
<Setter Property="ToolTip" Value="Restore"/>
<Setter Property="AutomationProperties.Name" Value="Restore"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button
Content="&#xD7;" BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,0,0,0"
FontFamily="{DynamicResource FontFamily}"
Foreground="{DynamicResource MainForegroundColor}" FontSize="{DynamicResource CloseIconFontSize}" Name="WPFCloseButton" />
Content="&#xE8BB;"
Style="{StaticResource HoverButtonStyle}"
BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0"
FontFamily="Segoe MDL2 Assets"
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource CloseIconFontSize}"
ToolTip="Close"
AutomationProperties.Name="Close"
Name="WPFCloseButton" />
</StackPanel>
</Grid>
</Grid>