Files
StarterNG/StarterNG/MainWindow.axaml
2026-08-25 21:22:39 +02:00

116 lines
7.1 KiB
XML

<Window
x:Class="StarterNG.MainWindow"
x:CompileBindings="True"
xmlns="https://github.com/avaloniaui"
xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="clr-namespace:StarterNG.Views"
xmlns:starterNg="clr-namespace:StarterNG"
Title="Starter MaSzyna"
Icon="/Assets/starter.ico"
Width="1200" Height="768" MinWidth="1200" MinHeight="666"
WindowStartupLocation="CenterScreen">
<!-- The client area is extended over the title bar in code-behind (the
ExtendClientArea* hints), so the logo + nav sit on the top bar while the
standard minimise / maximise / close buttons stay in the top-right corner.
Extending the client area also makes Avalonia 12 add an extra full-screen caption
button; it is hidden in App.axaml via its WindowDecorationProperties.ElementRole. -->
<DockPanel LastChildFill="True">
<!-- ── Top bar: thin caption strip (row 0) + toolbar (row 1) ────────────
The OS minimise / maximise / close buttons render at the top-right of
the caption strip, so they sit ABOVE the social-icon cluster, which
lives on the right of the toolbar row. -->
<Border DockPanel.Dock="Top"
Background="{StaticResource CarbonPanelBg}"
BorderBrush="{StaticResource CarbonBorderLight}"
BorderThickness="0,0,0,1">
<Grid RowDefinitions="48">
<!-- Logo + navigation (left) and the right cluster (right) -->
<!-- Drag-to-move handled by PointerPressed on parent grid -->
<Grid ColumnDefinitions="Auto,Auto,*,Auto"
Background="Transparent"
PointerPressed="TitleBar_OnPointerPressed">
<!-- Logo -->
<Image Grid.Column="0" Source="/Assets/Logo/maszyna_white.png"
Height="34" Margin="14,0,18,0" VerticalAlignment="Center" />
<!-- Page tabs -->
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Stretch">
<RadioButton x:Name="NavScenarios" GroupName="nav" Theme="{StaticResource NavTab}"
Tag="scenarios" IsChecked="True"
IsCheckedChanged="Nav_OnCheckedChanged"
Content="{Binding [NavScenarios], Source={x:Static starterNg:App.Loc}}" />
<RadioButton x:Name="NavDepot" GroupName="nav" Theme="{StaticResource NavTab}"
Tag="depot"
IsCheckedChanged="Nav_OnCheckedChanged"
Content="{Binding [NavDepot], Source={x:Static starterNg:App.Loc}}" />
<RadioButton x:Name="NavSettings" GroupName="nav" Theme="{StaticResource NavTab}"
Tag="settings"
IsCheckedChanged="Nav_OnCheckedChanged"
Content="{Binding [NavSettings], Source={x:Static starterNg:App.Loc}}" />
<Button Classes="Basic" Click="openLastLogClick" Width="48" Cursor="Hand"
HorizontalContentAlignment="Center"
ToolTip.Tip="{Binding [ShowLatestLogTooltip], Source={x:Static starterNg:App.Loc}}">
<materialIcons:MaterialIcon Kind="FileDocument" Height="16" Width="16" />
</Button>
<Button x:Name="HelpButton" Classes="Basic" Width="48" Cursor="Hand"
ToolTip.Tip="{Binding [Help], Source={x:Static starterNg:App.Loc}}"
Click="HelpButton_OnClick"
Content="?" FontWeight="Bold" FontSize="16"
HorizontalContentAlignment="Center" />
</StackPanel>
<!-- Right cluster: version, language, social links.
In the toolbar row, so it sits below the OS caption buttons. -->
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center"
Margin="0,0,8,0" Spacing="4">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,8,0">
<Label Content="{Binding [Version], Source={x:Static starterNg:App.Loc}}"
FontSize="10" Foreground="{StaticResource CarbonFgDim}" Padding="0" />
<Label Content="{x:Static starterNg:AppInfo.Version}"
FontSize="10" Foreground="{StaticResource CarbonFg}" Padding="0" />
</StackPanel>
<ComboBox x:Name="LangCombo" Width="110" VerticalAlignment="Center"
SelectionChanged="LangCombo_OnSelectionChanged" />
<Button Classes="Basic" Cursor="Hand" Tag="http://eu07.pl/" Click="linkClick">
<materialIcons:MaterialIcon Kind="Web" />
</Button>
<Button Classes="Basic" Cursor="Hand" Tag="https://discord.gg/eu07" Click="linkClick">
<PathIcon Data="{StaticResource DiscordLogo}" Height="12" />
</Button>
<Button Classes="Basic" Cursor="Hand" Tag="http://www.facebook.com/MaSzynaeu07pl" Click="linkClick">
<materialIcons:MaterialIcon Kind="Facebook" />
</Button>
<Button Classes="Basic" Cursor="Hand" Tag="http://www.youtube.com/@eu07official" Click="linkClick">
<materialIcons:MaterialIcon Kind="Youtube" />
</Button>
<Button Classes="Basic" Cursor="Hand" Tag="http://github.com/MaSzyna-EU07/" Click="linkClick">
<materialIcons:MaterialIcon Kind="Github" />
</Button>
</StackPanel>
</Grid>
</Grid>
</Border>
<!-- ── Full-width START button (bottom) ─────────────────────────────── -->
<Button Name="startButton" DockPanel.Dock="Bottom" Classes="Start" Height="44" Margin="6"
Click="StartButton_OnClick"
Content="{Binding [Start], Source={x:Static starterNg:App.Loc}}" />
<!-- ── Page host (one view visible at a time, like the original PageControl) -->
<Panel Margin="6,6,6,0">
<views:Scenarios x:Name="ScenariosView" />
<views:Depot x:Name="DepotView" IsVisible="False" />
<views:Settings x:Name="SettingsView" IsVisible="False" />
</Panel>
</DockPanel>
</Window>