2024-06-12 20:54:10 -07:00
|
|
|
<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:m="using:SourceGit.Models"
|
|
|
|
xmlns:c="using:SourceGit.Converters"
|
|
|
|
xmlns:v="using:SourceGit.Views"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="SourceGit.Views.Launcher"
|
|
|
|
x:DataType="vm:Launcher"
|
|
|
|
Icon="/App.ico"
|
|
|
|
Title="SourceGit"
|
|
|
|
MinWidth="1280" MinHeight="720"
|
|
|
|
WindowStartupLocation="CenterScreen">
|
2024-06-26 05:56:29 -07:00
|
|
|
<Grid x:Name="MainLayout">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Grid.RowDefinitions>
|
2024-06-26 05:56:29 -07:00
|
|
|
<RowDefinition Height="38"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
2024-03-14 03:23:36 -07:00
|
|
|
<!-- Custom TitleBar -->
|
2024-02-05 23:08:37 -08:00
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto">
|
|
|
|
<!-- Bottom border -->
|
2024-03-07 19:13:53 -08:00
|
|
|
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
|
|
|
Background="{DynamicResource Brush.TitleBar}"
|
|
|
|
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
2024-06-12 20:54:10 -07:00
|
|
|
DoubleTapped="OnTitleBarDoubleTapped"
|
2024-06-13 02:55:22 -07:00
|
|
|
PointerPressed="BeginMoveWindow"
|
|
|
|
PointerMoved="MoveWindow"
|
|
|
|
PointerReleased="EndMoveWindow"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- 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}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<v:CaptionButtonsMacOS VerticalAlignment="Bottom"/>
|
|
|
|
</Border>
|
|
|
|
|
2024-06-26 05:56:29 -07:00
|
|
|
<!-- Menu (Windows/Linux) -->
|
2024-06-29 02:04:39 -07:00
|
|
|
<Button Grid.Column="0" Classes="icon_button" VerticalAlignment="Bottom" Margin="6,0,2,3" IsVisible="{OnPlatform True, macOS=False}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Button.Flyout>
|
2024-02-06 01:00:39 -08:00
|
|
|
<MenuFlyout Placement="BottomEdgeAlignedLeft" VerticalOffset="-8">
|
2024-05-11 03:06:31 -07:00
|
|
|
<MenuItem Header="{DynamicResource Text.Preference}" Command="{x:Static s:App.OpenPreferenceCommand}" InputGesture="Ctrl+Shift+P">
|
2024-02-05 23:08:37 -08:00
|
|
|
<MenuItem.Icon>
|
2024-06-17 04:44:54 -07:00
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Settings}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</MenuItem.Icon>
|
|
|
|
</MenuItem>
|
2024-05-10 20:31:14 -07:00
|
|
|
<MenuItem Header="{DynamicResource Text.Hotkeys}" Command="{x:Static s:App.OpenHotkeysCommand}">
|
2024-03-04 18:46:08 -08:00
|
|
|
<MenuItem.Icon>
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Hotkeys}"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
</MenuItem>
|
2024-03-26 07:11:06 -07:00
|
|
|
<MenuItem Header="-"/>
|
2024-05-10 20:31:14 -07:00
|
|
|
<MenuItem Header="{DynamicResource Text.SelfUpdate}" Command="{x:Static s:App.CheckForUpdateCommand}">
|
2024-03-26 07:11:06 -07:00
|
|
|
<MenuItem.Icon>
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.SoftwareUpdate}"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
</MenuItem>
|
|
|
|
<MenuItem Header="-"/>
|
2024-05-10 20:31:14 -07:00
|
|
|
<MenuItem Header="{DynamicResource Text.About}" Command="{x:Static s:App.OpenAboutCommand}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<MenuItem.Icon>
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Info}"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
</MenuItem>
|
|
|
|
</MenuFlyout>
|
|
|
|
</Button.Flyout>
|
2024-02-17 18:41:41 -08:00
|
|
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Menu}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Button>
|
|
|
|
|
|
|
|
<!-- Pages Tabs-->
|
2024-06-26 05:56:29 -07:00
|
|
|
<v:LauncherTabBar Grid.Column="1" Height="30" VerticalAlignment="Bottom"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-03-14 03:23:36 -07:00
|
|
|
<!-- Caption Buttons (Windows/Linux)-->
|
|
|
|
<Border Grid.Column="2" Margin="32,0,0,0" IsVisible="{OnPlatform True, macOS=False}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<v:CaptionButtons Height="30" VerticalAlignment="Top"/>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
|
2024-03-02 06:45:14 -08:00
|
|
|
<!-- Page body -->
|
2024-05-30 00:13:59 -07:00
|
|
|
<ContentControl Grid.Row="1" Background="{DynamicResource Brush.ToolBar}" Content="{Binding ActivePage.Data}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="vm:Welcome">
|
|
|
|
<v:Welcome/>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="vm:Repository">
|
|
|
|
<v:Repository/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- Popup container -->
|
2024-06-13 18:44:44 -07:00
|
|
|
<Grid Grid.Row="1" Margin="0,36,0,0" IsVisible="{Binding ActivePage.Popup, Converter={x:Static ObjectConverters.IsNotNull}}" ClipToBounds="True">
|
2024-03-07 23:52:40 -08:00
|
|
|
<Border Background="Transparent" PointerPressed="OnPopupCancelByClickMask"/>
|
|
|
|
|
2024-06-24 04:52:00 -07:00
|
|
|
<Border Width="500" HorizontalAlignment="Center" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #8F000000)" CornerRadius="0,0,8,8" ClipToBounds="True">
|
2024-06-13 18:44:44 -07:00
|
|
|
<ContentControl Content="{Binding ActivePage.Popup}" Background="{DynamicResource Brush.Popup}">
|
2024-03-07 23:52:40 -08:00
|
|
|
<ContentControl.DataTemplates>
|
2024-06-13 18:44:44 -07:00
|
|
|
<DataTemplate DataType="vm:Popup">
|
|
|
|
<StackPanel Orientation="Vertical" Background="{DynamicResource Brush.Popup}">
|
|
|
|
<!-- Popup Widget -->
|
|
|
|
<ContentPresenter Margin="8,16,8,8"
|
|
|
|
Content="{Binding View}"
|
|
|
|
IsHitTestVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}"/>
|
2024-06-13 06:14:50 -07:00
|
|
|
|
2024-06-13 18:44:44 -07:00
|
|
|
<!-- Options -->
|
|
|
|
<StackPanel Margin="8,4,8,8"
|
|
|
|
Height="32"
|
|
|
|
Orientation="Horizontal"
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">
|
|
|
|
<Button Classes="flat primary"
|
|
|
|
Width="80"
|
|
|
|
Content="{DynamicResource Text.Sure}"
|
|
|
|
Click="OnPopupSure"
|
|
|
|
HotKey="Enter"/>
|
|
|
|
<Button Classes="flat"
|
|
|
|
Width="80"
|
|
|
|
Margin="8,0,0,0"
|
|
|
|
Content="{DynamicResource Text.Cancel}"
|
|
|
|
Click="OnPopupCancel"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
2024-06-13 18:44:44 -07:00
|
|
|
|
|
|
|
<!-- Running -->
|
|
|
|
<v:PopupRunningStatus Margin="12,8"
|
|
|
|
Description="{Binding ProgressDescription}"
|
|
|
|
IsVisible="{Binding InProgress}"/>
|
|
|
|
</StackPanel>
|
2024-03-07 23:52:40 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
2024-06-13 18:44:44 -07:00
|
|
|
</Border>
|
2024-03-07 23:52:40 -08:00
|
|
|
</Grid>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- Notification container -->
|
|
|
|
<Grid Grid.Row="1" Width="360" Margin="0,36,0,0" HorizontalAlignment="Right" VerticalAlignment="Top">
|
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
|
|
|
<ItemsControl ItemsSource="{Binding ActivePage.Notifications}">
|
|
|
|
<ItemsControl.ItemTemplate>
|
2024-06-26 05:56:29 -07:00
|
|
|
<DataTemplate DataType="vm:Notification">
|
2024-06-24 04:52:00 -07:00
|
|
|
<Border Margin="10,6" HorizontalAlignment="Stretch" VerticalAlignment="Top" Effect="drop-shadow(0 0 12 #A0000000)">
|
|
|
|
<Border Padding="8" CornerRadius="6" Background="{DynamicResource Brush.Popup}">
|
|
|
|
<Grid RowDefinitions="26,Auto,32">
|
|
|
|
<StackPanel Grid.Row="0" Margin="8,0,0,0" Orientation="Horizontal" IsVisible="{Binding IsError}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Error}" Fill="Red"/>
|
|
|
|
<TextBlock Margin="8,0,0,0" FontWeight="Bold" FontSize="14" Text="{DynamicResource Text.Launcher.Error}"/>
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="0" Margin="8,0,0,0" Orientation="Horizontal" IsVisible="{Binding !IsError}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Info}" Fill="Green"/>
|
|
|
|
<TextBlock Margin="8,0,0,0" FontWeight="Bold" FontSize="14" Text="{DynamicResource Text.Launcher.Info}"/>
|
|
|
|
</StackPanel>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-06-24 04:52:00 -07:00
|
|
|
<TextBox Grid.Row="1"
|
|
|
|
Classes="no_background no_border"
|
|
|
|
IsReadOnly="True"
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
MaxHeight="100"
|
|
|
|
Margin="8" Padding="0"
|
|
|
|
VerticalContentAlignment="Top"
|
|
|
|
Text="{Binding Message}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-06-24 04:52:00 -07:00
|
|
|
<StackPanel Grid.Row="2" Margin="0,4,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
|
|
<Button Classes="flat"
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
Command="{Binding CopyMessage}"
|
|
|
|
Content="{DynamicResource Text.CopyMessage}"
|
|
|
|
IsVisible="{Binding IsError}"/>
|
|
|
|
|
|
|
|
<Button Classes="flat primary"
|
|
|
|
Margin="0,0"
|
2024-06-26 05:56:29 -07:00
|
|
|
Content="{DynamicResource Text.Close}"
|
|
|
|
Click="OnDismissNotification"/>
|
2024-06-24 04:52:00 -07:00
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</Border>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
</ScrollViewer>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
2024-06-12 20:54:10 -07:00
|
|
|
</v:ChromelessWindow>
|