0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 08:30:44 -05:00
waffle.lord 47efa367e9 remove windows only font (!67)
fixes [#732](SPT/Issues#732)

- remove the windows only font used on some icons
- replaces those html code icons with geometry paths

Reviewed-on: SPT/Launcher#67
Co-authored-by: waffle.lord <waffle.lord@hotmail.com>
Co-committed-by: waffle.lord <waffle.lord@hotmail.com>
2024-09-17 16:36:11 +00:00

111 lines
4.1 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"
xmlns:helpers="using:SPT.Launcher.Helpers"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SPT.Launcher.CustomControls.TitleBar">
<Grid ColumnDefinitions="AUTO,*,AUTO,10,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"
/>
<!-- Setting button -->
<Button Grid.Column="2"
FontSize="12"
Command="{Binding SettingsButtonCommand, RelativeSource={
RelativeSource AncestorType=UserControl}}"
Classes="link"
IsEnabled="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=AllowSettings}"
IsVisible="{Binding Source={x:Static helpers:LauncherSettingsProvider.Instance}, Path=AllowSettings}"
>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
<Viewbox Width="14" Height="14" Margin="2">
<Path Data="{StaticResource Gear}"
Fill="{Binding $parent[TextBlock].Foreground}"
/>
</Viewbox>
</TextBlock>
<TextBlock Text="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=settings_menu}"/>
</StackPanel>
</Button>
<!-- Minimize (-) Button -->
<Button Grid.Column="4"
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="{DynamicResource AccentBrush2}"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="Button:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentBrush3}"/>
</Style>
</Button.Styles>
</Button>
<!-- Close (X) Button -->
<Button Grid.Column="5"
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>