Files
StarterNG/StarterNG/MainWindow.axaml

122 lines
7.4 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"
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
OS minimise / maximise / close buttons stay in the top-right corner. -->
<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="32,48">
<!-- Row 0: title / caption strip. Transparent background makes the
whole strip a drag handle (PointerPressed -> BeginMoveDrag),
and the OS buttons render at its top-right. -->
<Border Grid.Row="0" Background="Transparent"
PointerPressed="TitleBar_OnPointerPressed">
<TextBlock Text="Starter MaSzyna" VerticalAlignment="Center"
Margin="14,0,0,0" FontSize="11"
Foreground="{StaticResource CarbonFgDim}" />
</Border>
<!-- Row 1: logo + navigation (left) and the right cluster (right) -->
<Grid Grid.Row="1" ColumnDefinitions="Auto,Auto,*,Auto">
<!-- 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" Width="48" Cursor="Hand"
ToolTip.Tip="{Binding [Help], Source={x:Static starterNg:App.Loc}}"
Tag="https://wiki.eu07.pl/" Click="linkClick"
Content="?" FontWeight="Bold" FontSize="16"
HorizontalContentAlignment="Center" />
</StackPanel>
<!-- Right cluster: version, language, log, 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="100" VerticalAlignment="Center"
SelectionChanged="LangCombo_OnSelectionChanged">
<ComboBoxItem>Polski</ComboBoxItem>
<ComboBoxItem>English</ComboBoxItem>
</ComboBox>
<Button Classes="Basic" Click="openLastLogClick"
ToolTip.Tip="{Binding [ShowLatestLogTooltip], Source={x:Static starterNg:App.Loc}}">
<materialIcons:MaterialIcon Kind="FileDocument" />
</Button>
<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 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>