sourcegit/src/Views/Launcher.axaml

104 lines
4.8 KiB
Text
Raw Normal View History

<v:ChromelessWindow 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:s="using:SourceGit"
xmlns:vm="using:SourceGit.ViewModels"
xmlns:v="using:SourceGit.Views"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SourceGit.Views.Launcher"
x:DataType="vm:Launcher"
x:Name="ThisControl"
Icon="/App.ico"
Title="SourceGit"
MinWidth="1024" MinHeight="600"
WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding #ThisControl.CaptionHeight}"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Custom TitleBar -->
2024-09-09 03:26:43 -07:00
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,*,Auto">
<!-- Bottom border -->
2024-09-09 03:26:43 -07:00
<Border Grid.Column="0" Grid.ColumnSpan="4"
2024-03-07 19:13:53 -08:00
Background="{DynamicResource Brush.TitleBar}"
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
DoubleTapped="OnTitleBarDoubleTapped"
2024-08-06 00:12:44 -07:00
PointerPressed="BeginMoveWindow"/>
<!-- Caption Buttons (macOS) -->
2024-03-07 19:13:53 -08:00
<Border Grid.Column="0" VerticalAlignment="Stretch" Margin="2,0,8,3" IsVisible="{OnPlatform False, macOS=True}">
<v:CaptionButtonsMacOS VerticalAlignment="Bottom"/>
</Border>
<!-- Menu (Windows/Linux) -->
<Button Grid.Column="0" Classes="icon_button" VerticalAlignment="Bottom" Margin="6,0,2,3" IsVisible="{OnPlatform True, macOS=False}">
<Button.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedLeft" VerticalOffset="-8">
<MenuItem Header="{DynamicResource Text.Preference}" Command="{x:Static s:App.OpenPreferenceCommand}" InputGesture="Ctrl+Shift+P">
<MenuItem.Icon>
2024-06-17 04:44:54 -07:00
<Path Width="14" Height="14" Data="{StaticResource Icons.Settings}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{DynamicResource Text.OpenAppDataDir}" Command="{x:Static s:App.OpenAppDataDirCommand}">
<MenuItem.Icon>
<Path Width="14" Height="14" Data="{StaticResource Icons.Explore}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{DynamicResource Text.Hotkeys}" Command="{x:Static s:App.OpenHotkeysCommand}">
<MenuItem.Icon>
<Path Width="14" Height="14" Data="{StaticResource Icons.Hotkeys}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="-"/>
<MenuItem Header="{DynamicResource Text.SelfUpdate}" Command="{x:Static s:App.CheckForUpdateCommand}">
<MenuItem.Icon>
<Path Width="14" Height="14" Data="{StaticResource Icons.SoftwareUpdate}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="-"/>
<MenuItem Header="{DynamicResource Text.About}" Command="{x:Static s:App.OpenAboutCommand}">
<MenuItem.Icon>
<Path Width="14" Height="14" Data="{StaticResource Icons.Info}"/>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Button.Flyout>
<Path Width="12" Height="12" Data="{StaticResource Icons.Menu}"/>
</Button>
2024-09-09 03:26:43 -07:00
<!-- Workspace Switcher -->
2024-09-23 19:09:54 -07:00
<Button Grid.Column="1" Classes="icon_button" VerticalAlignment="Bottom" Margin="0,0,0,1" Click="OnOpenWorkspaceMenu">
2024-09-09 03:47:53 -07:00
<ToolTip.Tip>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{DynamicResource Text.Workspace}" FontWeight="Bold" Foreground="{DynamicResource Brush.FG2}"/>
<TextBlock Text="{Binding ActiveWorkspace.Name}"/>
</StackPanel>
</ToolTip.Tip>
2024-09-09 03:26:43 -07:00
<Path Width="14" Height="14"
Data="{StaticResource Icons.Workspace}"
Fill="{Binding ActiveWorkspace.Brush}"/>
</Button>
<!-- Pages Tabs-->
2024-09-09 03:26:43 -07:00
<v:LauncherTabBar Grid.Column="2" Height="30" VerticalAlignment="Bottom"/>
<!-- Caption Buttons (Windows/Linux)-->
2024-09-09 03:26:43 -07:00
<Border Grid.Column="3" Margin="32,0,0,0" IsVisible="{Binding #ThisControl.IsRightCaptionButtonsVisible}">
<v:CaptionButtons Height="30" VerticalAlignment="Top"/>
</Border>
</Grid>
2024-07-14 09:30:31 -07:00
<!-- Page -->
<ContentControl Grid.Row="1" Content="{Binding ActivePage}">
2024-05-30 00:13:59 -07:00
<ContentControl.DataTemplates>
2024-07-14 09:30:31 -07:00
<DataTemplate DataType="vm:LauncherPage">
<v:LauncherPage/>
2024-05-30 00:13:59 -07:00
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
</Grid>
</v:ChromelessWindow>