sourcegit/src/Views/Launcher.xaml

73 lines
3.3 KiB
XML

<controls:Window
x:Class="SourceGit.Views.Launcher"
x:Name="me"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
xmlns:models="clr-namespace:SourceGit.Models"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
MinWidth="1024" MinHeight="768"
Title="{DynamicResource Text.About.Title}"
Width="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Width, Mode=TwoWay}"
Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}"
WindowState="{Binding Source={x:Static models:Preference.Instance}, Path=Window.State, Mode=TwoWay}"
Closing="OnClosing">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Titlebar -->
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="360"/>
</Grid.ColumnDefinitions>
<!-- Bottom border -->
<Rectangle Grid.Column="0" Grid.ColumnSpan="4" Fill="{DynamicResource Brush.Border0}" Height="1" VerticalAlignment="Bottom"/>
<!-- Main Menu -->
<Button
Grid.Column="0"
Margin="4,4,4,0"
Width="16"
Background="Transparent"
BorderThickness="0"
WindowChrome.IsHitTestVisibleInChrome="True"
Click="ToggleMainMenu">
<Path Data="{StaticResource Icon.Git}" Fill="{DynamicResource Brush.Logo}"/>
</Button>
<!-- Tabs -->
<widgets:PageTabBar
Grid.Column="1"
x:Name="tabs"
TabAdd="OnTabAdding"
TabSelected="OnTabSelected"
TabClosed="OnTabClosed"/>
<!-- Right controls -->
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:IconButton Click="Minimize" Width="48" IconSize="10" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
<ToggleButton Style="{StaticResource Style.ToggleButton.MaxOrRestore}" Width="48" IsChecked="{Binding ElementName=me, Path=IsMaximized}"/>
<controls:IconButton Click="Quit" Width="48" IconSize="10" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>
</StackPanel>
</Grid>
<!-- Contents -->
<controls:PageContainer x:Name="container" Grid.Row="1"/>
<!-- Alerts -->
<widgets:Exceptions
Grid.Row="1"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="330" Height="Auto"/>
</Grid>
</controls:Window>