sourcegit/src/Views/Launcher.xaml

81 lines
3.6 KiB
Text
Raw Normal View History

<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"
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
2022-10-18 00:02:54 -07:00
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}"
2022-01-03 22:52:13 -08:00
WindowState="{Binding Source={x:Static models:Preference.Instance}, Path=Window.State, Mode=TwoWay}"
Closing="OnClosing">
<Window.Resources>
<converters:WindowStateToTitleBarHeight x:Key="WindowStateToTitleBarHeight"/>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding ElementName=me, Path=WindowState, Converter={StaticResource WindowStateToTitleBarHeight}}"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
2021-04-29 05:05:55 -07:00
<!-- Titlebar -->
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="360"/>
</Grid.ColumnDefinitions>
2021-04-29 05:05:55 -07:00
<!-- Bottom border -->
<Rectangle Grid.Column="0" Grid.ColumnSpan="4" Fill="{DynamicResource Brush.Border0}" Height="1" VerticalAlignment="Bottom"/>
<!-- Main Menu -->
2022-10-16 19:12:59 -07:00
<Button
Grid.Column="0"
Width="28" Height="28"
VerticalAlignment="Bottom"
2022-10-16 19:12:59 -07:00
Background="Transparent"
BorderThickness="0"
WindowChrome.IsHitTestVisibleInChrome="True"
2022-10-16 19:12:59 -07:00
Click="ToggleMainMenu">
2023-07-20 06:00:43 -07:00
<Path Width="14" Height="14" Data="{StaticResource Icon.Menu}"/>
2022-10-16 19:12:59 -07:00
</Button>
2021-04-29 05:05:55 -07:00
<!-- Tabs -->
<widgets:PageTabBar
Grid.Column="1"
x:Name="tabs"
Height="30"
VerticalAlignment="Bottom"
TabAdd="OnTabAdding"
TabSelected="OnTabSelected"
TabClosed="OnTabClosed"/>
2021-04-29 05:05:55 -07:00
<!-- Right controls -->
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="30" 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>
2021-04-29 05:05:55 -07:00
<!-- 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>