2024-02-05 23:08:37 -08:00
|
|
|
<UserControl 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:m="using:SourceGit.Models"
|
|
|
|
xmlns:vm="using:SourceGit.ViewModels"
|
|
|
|
xmlns:v="using:SourceGit.Views"
|
|
|
|
xmlns:c="using:SourceGit.Converters"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="SourceGit.Views.Repository"
|
|
|
|
x:DataType="vm:Repository">
|
|
|
|
<Grid RowDefinitions="36,*" Background="{DynamicResource Brush.Window}">
|
|
|
|
<!-- Toolbar -->
|
|
|
|
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1" Background="{DynamicResource Brush.ToolBar}">
|
|
|
|
<Grid ColumnDefinitions="*,Auto,*">
|
2024-03-03 18:25:19 -08:00
|
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="4,0,0,0">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Button Classes="icon_button" Width="32" Command="{Binding OpenInFileManager}" ToolTip.Tip="{DynamicResource Text.Repository.Explore}">
|
|
|
|
<Path Width="15" Height="13" Data="{StaticResource Icons.Folder.Open}"/>
|
|
|
|
</Button>
|
|
|
|
<Button Classes="icon_button" Width="32" Command="{Binding OpenInTerminal}" ToolTip.Tip="{DynamicResource Text.Repository.Terminal}">
|
2024-03-28 02:42:13 -07:00
|
|
|
<Path Width="13" Height="13" Data="{StaticResource Icons.Terminal}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Button>
|
2024-02-20 18:12:52 -08:00
|
|
|
|
2024-03-27 23:48:20 -07:00
|
|
|
<Button Classes="icon_button" Width="32" ToolTip.Tip="{DynamicResource Text.Repository.OpenWith}">
|
2024-03-28 02:42:13 -07:00
|
|
|
<Path Width="13" Height="13" Data="{StaticResource Icons.OpenWith}"/>
|
|
|
|
<Button.Flyout>
|
|
|
|
<MenuFlyout Placement="BottomEdgeAlignedLeft" VerticalOffset="-8">
|
|
|
|
<MenuItem Header="{DynamicResource Text.Repository.Fleet}" Command="{Binding OpenInFleet}">
|
|
|
|
<MenuItem.Icon>
|
2024-03-28 18:45:36 -07:00
|
|
|
<Image Source="/Resources/ExternalToolIcons/fleet.png" Width="16" Height="16" RenderOptions.BitmapInterpolationMode="HighQuality"/>
|
2024-03-28 02:42:13 -07:00
|
|
|
</MenuItem.Icon>
|
|
|
|
</MenuItem>
|
|
|
|
<MenuItem Header="{DynamicResource Text.Repository.VSCode}" Command="{Binding OpenInVSCode}">
|
|
|
|
<MenuItem.Icon>
|
2024-03-28 18:45:36 -07:00
|
|
|
<Image Source="/Resources/ExternalToolIcons/vscode.png" Width="16" Height="16" RenderOptions.BitmapInterpolationMode="HighQuality"/>
|
2024-03-28 02:42:13 -07:00
|
|
|
</MenuItem.Icon>
|
|
|
|
</MenuItem>
|
2024-03-27 23:48:20 -07:00
|
|
|
</MenuFlyout>
|
2024-03-28 02:42:13 -07:00
|
|
|
</Button.Flyout>
|
|
|
|
</Button>
|
|
|
|
<ToggleButton Width="32"
|
|
|
|
Background="Transparent"
|
|
|
|
IsChecked="{Binding IsSearching, Mode=TwoWay}"
|
|
|
|
ToolTip.Tip="{DynamicResource Text.Repository.Search}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Search}"/>
|
|
|
|
</ToggleButton>
|
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
|
|
<Button Classes="icon_button" Width="32" Command="{Binding Fetch}" ToolTip.Tip="{DynamicResource Text.Fetch}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Fetch}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Command="{Binding Pull}" ToolTip.Tip="{DynamicResource Text.Pull}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Pull}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Command="{Binding Push}" ToolTip.Tip="{DynamicResource Text.Push}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Push}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Command="{Binding StashAll}" ToolTip.Tip="{DynamicResource Text.Stashes}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Stashes}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Command="{Binding ApplyPatch}" ToolTip.Tip="{DynamicResource Text.Apply}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Diff}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Rectangle Width="1" Height="16"
|
|
|
|
Margin="16,0,0,0"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Fill="{DynamicResource Brush.Border2}"/>
|
|
|
|
|
2024-02-22 18:54:50 -08:00
|
|
|
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Command="{Binding CreateNewBranch}" ToolTip.Tip="{DynamicResource Text.Repository.NewBranch}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Branch.Add}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button Classes="icon_button" Width="32" Margin="8,0,0,0" Click="OpenGitFlowMenu" ToolTip.Tip="{DynamicResource Text.GitFlow}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Flow}"/>
|
2024-02-20 18:12:52 -08:00
|
|
|
</Button>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
|
2024-03-03 18:25:19 -08:00
|
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,4,0">
|
2024-03-28 02:42:13 -07:00
|
|
|
<ToggleButton Classes="layout_direction"
|
2024-02-05 23:08:37 -08:00
|
|
|
Width="32" Height="26"
|
|
|
|
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseTwoColumnsLayoutInHistories, Mode=TwoWay}"
|
|
|
|
IsVisible="{Binding SelectedViewIndex, Converter={x:Static c:IntConverters.IsZero}}"
|
|
|
|
ToolTip.Tip="{DynamicResource Text.Histories.DisplayMode}"/>
|
|
|
|
|
2024-02-22 18:54:50 -08:00
|
|
|
<Button Classes="icon_button" Width="32" Command="{Binding Cleanup}" ToolTip.Tip="{DynamicResource Text.Repository.Clean}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Clean}"/>
|
|
|
|
</Button>
|
|
|
|
|
2024-02-23 03:16:28 -08:00
|
|
|
<Button Classes="icon_button" Width="32" Click="OpenStatistics" ToolTip.Tip="{DynamicResource Text.Repository.Statistics}">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Statistics}"/>
|
|
|
|
</Button>
|
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
<Button Classes="icon_button" Width="32" Command="{Binding OpenConfigure}" ToolTip.Tip="{DynamicResource Text.Repository.Configure}">
|
|
|
|
<Path Width="15" Height="15" Data="{StaticResource Icons.Settings1}"/>
|
|
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Body -->
|
|
|
|
<Grid Grid.Row="1">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="250" MinWidth="200" MaxWidth="400"/>
|
2024-03-26 00:18:34 -07:00
|
|
|
<ColumnDefinition Width="3"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
<!-- Left Normal Mode -->
|
|
|
|
<Grid Grid.Column="0" RowDefinitions="28,Auto,28,Auto,28,*,28,Auto,28,Auto" Margin="0,0,0,4" IsVisible="{Binding !IsSearching}">
|
|
|
|
<!-- WorkingCopy -->
|
2024-02-22 18:54:50 -08:00
|
|
|
<TextBlock Grid.Row="0" Classes="group_header_label" Text="{DynamicResource Text.Repository.Workspace}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<ListBox Grid.Row="1" Classes="page_switcher" Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}">
|
|
|
|
<ListBox.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Vertical"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ListBox.ItemsPanel>
|
|
|
|
|
|
|
|
<ListBoxItem Height="28" Padding="0">
|
|
|
|
<StackPanel Margin="16,0,0,0" Orientation="Horizontal">
|
|
|
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Histories}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Margin="8,0,0,0" Classes="monospace" Text="{DynamicResource Text.Histories}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
</ListBoxItem>
|
|
|
|
|
|
|
|
<ListBoxItem Height="28" Padding="0">
|
|
|
|
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="Auto,*,Auto">
|
|
|
|
<Path Grid.Column="0" Width="14" Height="14" Data="{StaticResource Icons.Send}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.WorkingCopy}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<Border Grid.Column="2"
|
|
|
|
Margin="6,0"
|
|
|
|
Height="18"
|
|
|
|
CornerRadius="9"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Background="{DynamicResource Brush.Badge}"
|
|
|
|
IsVisible="{Binding WorkingCopyChangesCount, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
|
|
|
|
<TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding WorkingCopyChangesCount}"/>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</ListBoxItem>
|
|
|
|
|
|
|
|
<ListBoxItem Height="28" Padding="0">
|
|
|
|
<Grid Margin="16,0,0,0" Height="28" ColumnDefinitions="Auto,*,Auto">
|
|
|
|
<Path Grid.Column="0" Width="14" Height="14" Data="{StaticResource Icons.Stashes}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.Stashes}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<Border Grid.Column="2"
|
|
|
|
Margin="6,0"
|
|
|
|
Height="18"
|
|
|
|
CornerRadius="9"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Background="{DynamicResource Brush.Badge}"
|
|
|
|
IsVisible="{Binding StashesCount, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
|
|
|
|
<TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding StashesCount}"/>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</ListBoxItem>
|
|
|
|
</ListBox>
|
|
|
|
|
|
|
|
<!-- Local Branches -->
|
2024-02-22 18:54:50 -08:00
|
|
|
<TextBlock Grid.Row="2" Classes="group_header_label" Text="{DynamicResource Text.Repository.LocalBranches}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<TreeView Grid.Row="3"
|
|
|
|
x:Name="localBranchTree"
|
|
|
|
MaxHeight="400"
|
|
|
|
ItemsSource="{Binding LocalBranchTrees}"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
LostFocus="OnLocalBranchTreeLostFocus"
|
|
|
|
SelectionChanged="OnLocalBranchTreeSelectionChanged">
|
2024-03-09 04:58:00 -08:00
|
|
|
<TreeView.Styles>
|
|
|
|
<Style Selector="TreeViewItem" x:DataType="m:BranchTreeNode">
|
|
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
|
|
|
</Style>
|
|
|
|
</TreeView.Styles>
|
2024-02-05 23:08:37 -08:00
|
|
|
<TreeView.ItemTemplate>
|
|
|
|
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type m:BranchTreeNode}">
|
|
|
|
<Grid Height="24" ColumnDefinitions="Auto,*,Auto,Auto" Background="Transparent" ContextRequested="OnLocalBranchContextMenuRequested" DoubleTapped="OnDoubleTappedLocalBranchNode">
|
|
|
|
<Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" Margin="0,1,0,0" IsVisible="{Binding IsFolder}"/>
|
|
|
|
<Path Grid.Column="0" Width="10" Height="10" Margin="0,2,0,0" Data="{StaticResource Icons.Check}" IsVisible="{Binding IsCurrent}" VerticalAlignment="Center"/>
|
|
|
|
<Path Grid.Column="0" Width="10" Height="10" Data="{StaticResource Icons.Branch}" VerticalAlignment="Center">
|
|
|
|
<Path.IsVisible>
|
|
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
|
|
<Binding Path="!IsFolder"/>
|
|
|
|
<Binding Path="!IsCurrent"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</Path.IsVisible>
|
|
|
|
</Path>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" FontWeight="Bold" Margin="8,0,4,0" IsVisible="{Binding IsCurrent}"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" Margin="8,0,4,0" IsVisible="{Binding !IsCurrent}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<Border Grid.Column="2" Margin="8,0" Height="18" CornerRadius="9" VerticalAlignment="Center" Background="{DynamicResource Brush.Badge}" IsVisible="{Binding IsUpstreamTrackStatusVisible}">
|
|
|
|
<TextBlock Classes="monospace" FontSize="10" HorizontalAlignment="Center" Margin="9,0" Text="{Binding UpstreamTrackStatus}"/>
|
|
|
|
</Border>
|
|
|
|
|
2024-03-28 02:42:13 -07:00
|
|
|
<ToggleButton Grid.Column="3"
|
|
|
|
Classes="filter"
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
Background="Transparent"
|
|
|
|
IsVisible="{Binding IsBranch}"
|
|
|
|
Checked="OnToggleFilter"
|
2024-02-06 01:52:16 -08:00
|
|
|
Unchecked="OnToggleFilter"
|
|
|
|
IsChecked="{Binding IsFiltered}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</TreeDataTemplate>
|
|
|
|
</TreeView.ItemTemplate>
|
|
|
|
</TreeView>
|
|
|
|
|
|
|
|
<!-- Remotes -->
|
|
|
|
<Grid Grid.Row="4" ColumnDefinitions="*,Auto">
|
|
|
|
<TextBlock Grid.Column="0" Classes="group_header_label" Text="{DynamicResource Text.Repository.Remotes}"/>
|
|
|
|
<Button Grid.Column="1" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding AddRemote}" ToolTip.Tip="{DynamicResource Text.Repository.Remotes.Add}">
|
|
|
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Remote.Add}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
<TreeView Grid.Row="5"
|
|
|
|
x:Name="remoteBranchTree"
|
|
|
|
ItemsSource="{Binding RemoteBranchTrees}"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
|
|
LostFocus="OnRemoteBranchTreeLostFocus"
|
|
|
|
SelectionChanged="OnRemoteBranchTreeSelectionChanged">
|
2024-03-09 04:58:00 -08:00
|
|
|
<TreeView.Styles>
|
|
|
|
<Style Selector="TreeViewItem" x:DataType="m:BranchTreeNode">
|
|
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
|
|
|
</Style>
|
|
|
|
</TreeView.Styles>
|
2024-03-28 02:42:13 -07:00
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
<TreeView.ItemTemplate>
|
|
|
|
<TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="{x:Type m:BranchTreeNode}">
|
|
|
|
<Grid Height="24" ColumnDefinitions="Auto,*,Auto" Background="Transparent" ContextRequested="OnRemoteBranchContextMenuRequested">
|
|
|
|
<Path Grid.Column="0" Classes="folder_icon" Width="10" Height="10" Margin="0,2,0,0" IsVisible="{Binding IsFolder}" VerticalAlignment="Center"/>
|
|
|
|
<Path Grid.Column="0" Width="10" Height="10" Margin="0,4,0,0" Data="{StaticResource Icons.Remote}" IsVisible="{Binding IsRemote}" VerticalAlignment="Center"/>
|
|
|
|
<Path Grid.Column="0" Width="10" Height="10" Data="{StaticResource Icons.Branch}" IsVisible="{Binding IsBranch}" VerticalAlignment="Center"/>
|
2024-03-28 02:42:13 -07:00
|
|
|
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}" Classes="monospace" Margin="8,0,4,0"/>
|
2024-03-28 02:42:13 -07:00
|
|
|
|
|
|
|
<ToggleButton Grid.Column="2"
|
|
|
|
Classes="filter"
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
Background="Transparent"
|
|
|
|
Checked="OnToggleFilter"
|
|
|
|
Unchecked="OnToggleFilter"
|
2024-02-06 01:52:16 -08:00
|
|
|
IsVisible="{Binding IsBranch}"
|
|
|
|
IsChecked="{Binding IsFiltered}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</TreeDataTemplate>
|
|
|
|
</TreeView.ItemTemplate>
|
|
|
|
</TreeView>
|
|
|
|
|
|
|
|
<!-- Tags -->
|
2024-03-20 20:40:17 -07:00
|
|
|
<ToggleButton Grid.Row="6" Classes="group_expander" IsChecked="{Binding IsTagGroupExpanded, Mode=TwoWay}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Grid ColumnDefinitions="Auto,*,Auto">
|
|
|
|
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Tags}"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="{Binding Tags, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
|
|
|
<Button Grid.Column="2" Classes="icon_button" Width="14" Margin="8,0" Command="{Binding CreateNewTag}" ToolTip.Tip="{DynamicResource Text.Repository.Tags.Add}">
|
|
|
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Tag.Add}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</ToggleButton>
|
|
|
|
<DataGrid Grid.Row="7"
|
|
|
|
MaxHeight="200"
|
|
|
|
Background="Transparent"
|
|
|
|
ItemsSource="{Binding Tags}"
|
|
|
|
SelectionMode="Single"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="24"
|
|
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
LostFocus="OnTagDataGridLostFocus"
|
2024-03-20 20:40:17 -07:00
|
|
|
IsVisible="{Binding IsTagGroupExpanded, Mode=OneWay}"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionChanged="OnTagDataGridSelectionChanged"
|
|
|
|
ContextRequested="OnTagContextRequested">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Tag}">
|
|
|
|
<Path Width="10" Height="10" Margin="16,0,8,0" Data="{StaticResource Icons.Tag}"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Width="*" Header="NAME">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Tag}">
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Text="{Binding Name}" Classes="monospace" TextTrimming="CharacterEllipsis" />
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="FILTER">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Tag}">
|
2024-03-28 02:42:13 -07:00
|
|
|
<ToggleButton Classes="filter"
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
Background="Transparent"
|
|
|
|
Checked="OnToggleFilter"
|
2024-02-06 01:52:16 -08:00
|
|
|
Unchecked="OnToggleFilter"
|
|
|
|
IsChecked="{Binding IsFiltered}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<!-- Submodules -->
|
2024-03-20 20:40:17 -07:00
|
|
|
<ToggleButton Grid.Row="8" Classes="group_expander" IsChecked="{Binding IsSubmoduleGroupExpanded, Mode=TwoWay}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
|
|
|
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Submodules}"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="{Binding Submodules, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
2024-03-28 02:42:13 -07:00
|
|
|
<Button Grid.Column="2"
|
|
|
|
Classes="icon_button"
|
|
|
|
Width="14"
|
|
|
|
Margin="8,0"
|
2024-02-05 23:08:37 -08:00
|
|
|
Click="UpdateSubmodules"
|
|
|
|
IsVisible="{Binding Submodules, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}"
|
|
|
|
ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Update}">
|
|
|
|
<Path x:Name="iconSubmoduleUpdate" Width="12" Height="12" Data="{StaticResource Icons.Loading}"/>
|
|
|
|
</Button>
|
|
|
|
<Button Grid.Column="3" Classes="icon_button" Width="14" Margin="0,0,8,0" Command="{Binding AddSubmodule}" ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Add}">
|
|
|
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Submodule}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</ToggleButton>
|
|
|
|
<DataGrid Grid.Row="9"
|
|
|
|
MaxHeight="200"
|
|
|
|
Background="Transparent"
|
|
|
|
ItemsSource="{Binding Submodules}"
|
|
|
|
SelectionMode="Single"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="26"
|
|
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
ContextRequested="OnSubmoduleContextRequested"
|
2024-03-20 20:40:17 -07:00
|
|
|
IsVisible="{Binding IsSubmoduleGroupExpanded, Mode=OneWay}">
|
2024-02-05 23:08:37 -08:00
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Header="ICON">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Path Width="10" Height="10" Margin="16,0,8,0" Data="{StaticResource Icons.Submodule}"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Width="*" Header="NAME">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Text="{Binding}" Classes="monospace"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Left Search Mode -->
|
2024-03-07 00:18:51 -08:00
|
|
|
<Grid Grid.Column="0" RowDefinitions="32,*" IsVisible="{Binding IsSearching}" PropertyChanged="OnSearchCommitPanelPropertyChanged">
|
2024-02-05 23:08:37 -08:00
|
|
|
<!-- Search -->
|
2024-03-28 02:42:13 -07:00
|
|
|
<TextBox Grid.Row="0"
|
2024-03-11 03:54:12 -07:00
|
|
|
x:Name="txtSearchCommitsBox"
|
|
|
|
Margin="4,2"
|
|
|
|
Height="24"
|
|
|
|
BorderThickness="1"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border2}"
|
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
Watermark="{DynamicResource Text.Repository.SearchTip}"
|
|
|
|
Text="{Binding SearchCommitFilter, Mode=TwoWay}"
|
|
|
|
VerticalContentAlignment="Center"
|
|
|
|
KeyDown="OnSearchKeyDown">
|
|
|
|
<TextBox.InnerLeftContent>
|
2024-02-20 18:12:52 -08:00
|
|
|
<Path Width="14" Height="14"
|
2024-03-11 03:54:12 -07:00
|
|
|
Margin="6,0,0,0"
|
|
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
|
|
Data="{StaticResource Icons.Search}"/>
|
|
|
|
</TextBox.InnerLeftContent>
|
|
|
|
|
|
|
|
<TextBox.InnerRightContent>
|
|
|
|
<Button Classes="icon_button"
|
|
|
|
Width="16"
|
|
|
|
Margin="0,0,6,0"
|
|
|
|
Command="{Binding ClearSearchCommitFilter}"
|
|
|
|
IsVisible="{Binding SearchCommitFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
|
|
|
HorizontalAlignment="Right">
|
|
|
|
<Path Width="14" Height="14"
|
|
|
|
Margin="0,1,0,0"
|
|
|
|
Fill="{DynamicResource Brush.FG1}"
|
|
|
|
Data="{StaticResource Icons.Clear}"/>
|
|
|
|
</Button>
|
|
|
|
</TextBox.InnerRightContent>
|
|
|
|
</TextBox>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<DataGrid Grid.Row="1"
|
2024-02-20 18:12:52 -08:00
|
|
|
ItemsSource="{Binding SearchedCommits}"
|
|
|
|
SelectionMode="Single"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="50"
|
2024-02-05 23:08:37 -08:00
|
|
|
BorderThickness="1"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border2}"
|
|
|
|
Background="{DynamicResource Brush.Contents}"
|
2024-02-20 18:12:52 -08:00
|
|
|
Margin="4,0,4,4"
|
|
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
2024-02-05 23:08:37 -08:00
|
|
|
SelectionChanged="OnSearchResultDataGridSelectionChanged">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Width="*">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate DataType="m:Commit">
|
|
|
|
<Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
|
|
|
|
<Grid RowDefinitions="Auto,*">
|
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto">
|
|
|
|
<v:Avatar Width="16" Height="16"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
IsHitTestVisible="False"
|
2024-03-04 23:53:38 -08:00
|
|
|
User="{Binding Author}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding Author.Name}" Margin="8,0,0,0"/>
|
|
|
|
<TextBlock Grid.Column="2" Classes="monospace" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0"/>
|
|
|
|
<TextBlock Grid.Column="3" Classes="monospace" Text="{Binding AuthorTimeShortStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Row="1" Text="{Binding Subject}" VerticalAlignment="Bottom"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
2024-03-28 02:42:13 -07:00
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
<Path Grid.Row="1"
|
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
Width="48" Height="48"
|
|
|
|
Data="{StaticResource Icons.Empty}"
|
|
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
|
|
IsVisible="{Binding SearchedCommits.Count, Converter={x:Static c:IntConverters.IsZero}}"/>
|
|
|
|
</Grid>
|
2024-03-26 00:18:34 -07:00
|
|
|
|
|
|
|
<!-- Splitter -->
|
2024-02-05 23:08:37 -08:00
|
|
|
<GridSplitter Grid.Column="1"
|
2024-03-26 00:18:34 -07:00
|
|
|
MinWidth="1"
|
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
|
|
Background="Transparent"
|
|
|
|
BorderThickness="0,0,1,0"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border0}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- Right -->
|
|
|
|
<Grid Grid.Column="2" RowDefinitions="Auto,*">
|
|
|
|
<Grid Height="26" Grid.Row="0" ColumnDefinitions="*,Auto,Auto,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding IsConflictBarVisible}">
|
|
|
|
<TextBlock Grid.Column="0" Margin="8,0" FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.Conflict.Tip}"/>
|
|
|
|
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Resolve}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding GotoResolve}">
|
|
|
|
<Button.IsVisible>
|
2024-02-17 23:44:05 -08:00
|
|
|
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsOne}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Button.IsVisible>
|
|
|
|
</Button>
|
|
|
|
<Button Grid.Column="2" Classes="flat primary" FontWeight="Regular" Content="{DynamicResource Text.Repository.Continue}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding ContinueMerge}" IsVisible="{Binding !HasUnsolvedConflict}"/>
|
|
|
|
<Button Grid.Column="3" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Abort}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding AbortMerge}"/>
|
|
|
|
</Grid>
|
|
|
|
|
2024-03-02 06:45:14 -08:00
|
|
|
<v:RepositorySubView Grid.Row="1" Data="{Binding SelectedView}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|