MadByte 7b8dd9ada6 remove windows only font
Port of commit 47efa367e9

- remove the windows only font used on some icons
- replaces those html code icons with geometry paths
2024-09-20 16:26:52 +02:00

84 lines
3.7 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPTInstaller.CustomControls.TitleBar">
<Grid ColumnDefinitions="AUTO,*,AUTO,AUTO">
<Rectangle Grid.ColumnSpan="6" IsHitTestVisible="False"
Fill="{Binding Background, RelativeSource={
RelativeSource AncestorType=UserControl}}" />
<Label Content="{Binding Title, RelativeSource={
RelativeSource AncestorType=UserControl}}"
IsHitTestVisible="False"
Foreground="{Binding Foreground, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Background="Transparent"
VerticalContentAlignment="Center" />
<!-- Minimize (-) Button -->
<Button Grid.Column="2"
Foreground="{Binding ButtonForeground, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Command="{Binding MinButtonCommand, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Background="Transparent"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
VerticalAlignment="Stretch"
CornerRadius="0"
Width="35">
<Viewbox Width="15" Height="15">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
<Path Data="{StaticResource Minimize}"
Fill="{Binding $parent[TextBlock].Foreground}"
/>
</TextBlock>
</Viewbox>
<Button.Styles>
<Style Selector="Button:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{StaticResource SPT_Brush_DarkGrayBlue}" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="Button:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{StaticResource SPT_Background_Light}" />
</Style>
</Button.Styles>
</Button>
<!-- Close (X) Button -->
<Button Grid.Column="3"
Foreground="{Binding ButtonForeground, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Command="{Binding XButtonCommand, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Background="Transparent"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
VerticalAlignment="Stretch"
CornerRadius="0"
Width="35">
<Viewbox Width="15" Height="15">
<TextBlock>
<Path Data="{StaticResource Close}"
Fill="{Binding $parent[TextBlock].Foreground}"
/>
</TextBlock>
</Viewbox>
<Button.Styles>
<Style Selector="Button:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="IndianRed" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="Button:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="Crimson" />
</Style>
</Button.Styles>
</Button>
</Grid>
</UserControl>