2024-06-20 02:02:12 -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:m="using:SourceGit.Models"
|
|
|
|
xmlns:vm="using:SourceGit.ViewModels"
|
|
|
|
xmlns:c="using:SourceGit.Converters"
|
|
|
|
xmlns:v="using:SourceGit.Views"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="SourceGit.Views.InteractiveRebase"
|
|
|
|
x:DataType="vm:InteractiveRebase"
|
2024-08-21 21:37:26 -07:00
|
|
|
x:Name="ThisControl"
|
2024-06-20 02:32:14 -07:00
|
|
|
Icon="/App.ico"
|
2024-06-20 02:02:12 -07:00
|
|
|
Title="{DynamicResource Text.InteractiveRebase}"
|
|
|
|
Width="1080" Height="720"
|
|
|
|
WindowStartupLocation="CenterOwner">
|
|
|
|
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
|
|
|
<!-- TitleBar -->
|
2024-10-31 06:36:51 -07:00
|
|
|
<Grid Grid.Row="0" Height="28" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
|
|
|
<Border Background="{DynamicResource Brush.TitleBar}"
|
2024-06-20 02:02:12 -07:00
|
|
|
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
|
|
|
PointerPressed="BeginMoveWindow"/>
|
|
|
|
|
2024-10-31 06:36:51 -07:00
|
|
|
<Path Width="14" Height="14"
|
2024-06-20 02:02:12 -07:00
|
|
|
Margin="10,0,0,0"
|
2024-10-31 06:36:51 -07:00
|
|
|
HorizontalAlignment="Left"
|
2024-06-20 02:02:12 -07:00
|
|
|
Data="{StaticResource Icons.InteractiveRebase}"
|
|
|
|
IsVisible="{OnPlatform True, macOS=False}"/>
|
|
|
|
|
2024-10-31 06:36:51 -07:00
|
|
|
<TextBlock Classes="bold"
|
2024-06-20 02:02:12 -07:00
|
|
|
Text="{DynamicResource Text.InteractiveRebase}"
|
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
IsHitTestVisible="False"/>
|
|
|
|
|
2024-10-31 06:36:51 -07:00
|
|
|
<v:CaptionButtons HorizontalAlignment="Right"
|
2024-09-01 01:54:20 -07:00
|
|
|
IsCloseButtonOnly="True"
|
|
|
|
IsVisible="{OnPlatform True, macOS=False}"/>
|
2024-06-20 02:02:12 -07:00
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Operation Information -->
|
|
|
|
<Grid Grid.Row="1" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*" Margin="8">
|
|
|
|
<TextBlock Grid.Column="0" Text="{DynamicResource Text.InteractiveRebase.Target}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
|
|
|
<Path Grid.Column="1" Width="14" Height="14" Margin="8,0,0,0" Data="{StaticResource Icons.Branch}"/>
|
2024-07-01 19:23:21 -07:00
|
|
|
<TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Current.FriendlyName}" Margin="8,0,0,0"/>
|
2024-06-20 02:02:12 -07:00
|
|
|
|
|
|
|
<TextBlock Grid.Column="3" Margin="48,0,0,0" Text="{DynamicResource Text.InteractiveRebase.On}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
|
|
|
<Path Grid.Column="4" Width="14" Height="14" Margin="8,8,0,0" Data="{StaticResource Icons.Commit}"/>
|
2024-07-29 05:48:04 -07:00
|
|
|
<TextBlock Grid.Column="5" Classes="primary" VerticalAlignment="Center" Text="{Binding On.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0"/>
|
2024-06-20 02:02:12 -07:00
|
|
|
<TextBlock Grid.Column="6" VerticalAlignment="Center" Text="{Binding On.Subject}" Margin="4,0,0,0" TextTrimming="CharacterEllipsis"/>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Body -->
|
2024-06-20 05:03:01 -07:00
|
|
|
<Border Grid.Row="2" Margin="8,0,8,8" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
2024-06-20 02:02:12 -07:00
|
|
|
<Grid RowDefinitions="*,3,*">
|
2024-10-11 19:28:54 -07:00
|
|
|
<v:InteractiveRebaseListBox Grid.Row="0"
|
|
|
|
Focusable="True"
|
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
ItemsSource="{Binding Items}"
|
|
|
|
SelectionMode="Single"
|
|
|
|
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto">
|
2024-08-27 06:28:48 -07:00
|
|
|
<ListBox.Styles>
|
|
|
|
<Style Selector="ListBoxItem">
|
|
|
|
<Setter Property="Margin" Value="0"/>
|
|
|
|
<Setter Property="Padding" Value="0"/>
|
|
|
|
<Setter Property="Height" Value="28"/>
|
2024-11-29 03:00:53 -08:00
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
2024-08-27 06:28:48 -07:00
|
|
|
</Style>
|
|
|
|
</ListBox.Styles>
|
|
|
|
|
|
|
|
<ListBox.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<VirtualizingStackPanel Orientation="Vertical"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ListBox.ItemsPanel>
|
|
|
|
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
<DataTemplate DataType="vm:InteractiveRebaseItem">
|
2024-11-29 05:03:11 -08:00
|
|
|
<Grid ColumnDefinitions="16,110,*,456" Margin="8,0" ClipToBounds="True">
|
2024-08-27 06:28:48 -07:00
|
|
|
<!-- Drag & Drop Anchor -->
|
|
|
|
<Border Grid.Column="0" Background="Transparent"
|
|
|
|
Loaded="OnSetupRowHeaderDragDrop"
|
|
|
|
PointerPressed="OnRowHeaderPointerPressed">
|
2024-11-28 05:40:51 -08:00
|
|
|
<Path Width="14" Height="14"
|
|
|
|
Data="{StaticResource Icons.Move}"
|
|
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
VerticalAlignment="Center"/>
|
2024-08-27 06:28:48 -07:00
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Action -->
|
|
|
|
<Button Grid.Column="1" Opacity="1" Margin="4,0,0,0" Padding="8,2" Background="Transparent">
|
|
|
|
<Button.Flyout>
|
|
|
|
<MenuFlyout Placement="BottomEdgeAlignedLeft" VerticalOffset="-4">
|
|
|
|
<MenuItem InputGesture="P" Command="{Binding SetAction}" CommandParameter="{x:Static m:InteractiveRebaseAction.Pick}">
|
|
|
|
<MenuItem.Icon>
|
|
|
|
<Ellipse Width="14" Height="14" Fill="Green"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
<MenuItem.Header>
|
|
|
|
<Grid ColumnDefinitions="64,240">
|
|
|
|
<TextBlock Grid.Column="0" Classes="primary" Margin="4,0" Text="Pick"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="Use this commit" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Grid>
|
|
|
|
</MenuItem.Header>
|
|
|
|
</MenuItem>
|
|
|
|
|
|
|
|
<MenuItem InputGesture="E" Command="{Binding SetAction}" CommandParameter="{x:Static m:InteractiveRebaseAction.Edit}">
|
|
|
|
<MenuItem.Icon>
|
|
|
|
<Ellipse Width="14" Height="14" Fill="Orange"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
<MenuItem.Header>
|
|
|
|
<Grid ColumnDefinitions="64,240">
|
|
|
|
<TextBlock Grid.Column="0" Classes="primary" Margin="4,0" Text="Edit"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="Stop for amending" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Grid>
|
|
|
|
</MenuItem.Header>
|
|
|
|
</MenuItem>
|
|
|
|
|
|
|
|
<MenuItem InputGesture="R" Command="{Binding SetAction}" CommandParameter="{x:Static m:InteractiveRebaseAction.Reword}">
|
|
|
|
<MenuItem.Icon>
|
|
|
|
<Ellipse Width="14" Height="14" Fill="Orange"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
<MenuItem.Header>
|
|
|
|
<Grid ColumnDefinitions="64,240">
|
|
|
|
<TextBlock Grid.Column="0" Classes="primary" Margin="4,0" Text="Reword"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="Edit the commit message" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Grid>
|
|
|
|
</MenuItem.Header>
|
|
|
|
</MenuItem>
|
|
|
|
|
|
|
|
<MenuItem InputGesture="S" Command="{Binding SetAction}" CommandParameter="{x:Static m:InteractiveRebaseAction.Squash}">
|
|
|
|
<MenuItem.Icon>
|
|
|
|
<Ellipse Width="14" Height="14" Fill="LightGray"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
<MenuItem.Header>
|
|
|
|
<Grid ColumnDefinitions="64,240">
|
|
|
|
<TextBlock Grid.Column="0" Classes="primary" Margin="4,0" Text="Squash"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="Meld into previous commit" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Grid>
|
|
|
|
</MenuItem.Header>
|
|
|
|
</MenuItem>
|
|
|
|
|
|
|
|
<MenuItem InputGesture="F" Command="{Binding SetAction}" CommandParameter="{x:Static m:InteractiveRebaseAction.Fixup}">
|
|
|
|
<MenuItem.Icon>
|
|
|
|
<Ellipse Width="14" Height="14" Fill="LightGray"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
<MenuItem.Header>
|
|
|
|
<Grid ColumnDefinitions="64,240">
|
|
|
|
<TextBlock Grid.Column="0" Classes="primary" Margin="4,0" Text="Fixup"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="Like 'Squash' but discard message" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Grid>
|
|
|
|
</MenuItem.Header>
|
|
|
|
</MenuItem>
|
|
|
|
|
|
|
|
<MenuItem InputGesture="D" Command="{Binding SetAction}" CommandParameter="{x:Static m:InteractiveRebaseAction.Drop}">
|
|
|
|
<MenuItem.Icon>
|
|
|
|
<Ellipse Width="14" Height="14" Fill="Red"/>
|
|
|
|
</MenuItem.Icon>
|
|
|
|
<MenuItem.Header>
|
|
|
|
<Grid ColumnDefinitions="64,240">
|
|
|
|
<TextBlock Grid.Column="0" Classes="primary" Margin="4,0" Text="Drop"/>
|
|
|
|
<TextBlock Grid.Column="1" Text="Remove commit" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Grid>
|
|
|
|
</MenuItem.Header>
|
|
|
|
</MenuItem>
|
|
|
|
</MenuFlyout>
|
|
|
|
</Button.Flyout>
|
2024-06-20 02:02:12 -07:00
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
2024-08-27 06:28:48 -07:00
|
|
|
<Ellipse Width="14" Height="14" Fill="{Binding Action, Converter={x:Static c:InteractiveRebaseActionConverters.ToIconBrush}}"/>
|
|
|
|
<TextBlock Classes="primary" Margin="8,0" Text="{Binding Action, Converter={x:Static c:InteractiveRebaseActionConverters.ToName}}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<!-- Subject -->
|
2024-11-28 05:40:51 -08:00
|
|
|
<Grid Grid.Column="2" ColumnDefinitions="Auto,*" ClipToBounds="True">
|
|
|
|
<Button Grid.Column="0" Classes="icon_button" Margin="0,0,8,0" IsVisible="{Binding Action, Converter={x:Static c:InteractiveRebaseActionConverters.CanEditMessage}}">
|
2024-08-27 06:28:48 -07:00
|
|
|
<Button.Flyout>
|
|
|
|
<Flyout Placement="BottomEdgeAlignedLeft">
|
|
|
|
<Panel Width="600" Height="120">
|
|
|
|
<v:CommitMessageTextBox Text="{Binding FullMessage, Mode=TwoWay}"/>
|
|
|
|
</Panel>
|
|
|
|
</Flyout>
|
|
|
|
</Button.Flyout>
|
|
|
|
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Edit}"/>
|
2024-06-20 02:02:12 -07:00
|
|
|
</Button>
|
2024-11-28 05:40:51 -08:00
|
|
|
<TextBlock Grid.Column="1" Classes="primary" Margin="0,0,4,0" Text="{Binding Subject}"/>
|
|
|
|
</Grid>
|
2024-08-27 06:28:48 -07:00
|
|
|
|
2024-11-29 03:00:53 -08:00
|
|
|
<Grid Grid.Column="3" ColumnDefinitions="32,108,96,156,32,32" IsHitTestVisible="False" ClipToBounds="True">
|
|
|
|
<!-- Author Avatar -->
|
2024-11-28 05:40:51 -08:00
|
|
|
<v:Avatar Grid.Column="0"
|
|
|
|
Width="16" Height="16"
|
|
|
|
Margin="8,0,0,0"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
User="{Binding Commit.Author}"/>
|
2024-11-29 03:00:53 -08:00
|
|
|
|
|
|
|
<!-- Author Name -->
|
2024-11-28 05:40:51 -08:00
|
|
|
<TextBlock Grid.Column="1"
|
|
|
|
Classes="primary"
|
2024-11-29 03:00:53 -08:00
|
|
|
MaxWidth="90"
|
2024-11-28 05:40:51 -08:00
|
|
|
Margin="6,0,12,0"
|
|
|
|
Text="{Binding Commit.Author.Name}"
|
|
|
|
HorizontalAlignment="Left"/>
|
2024-08-27 06:28:48 -07:00
|
|
|
|
2024-11-29 03:00:53 -08:00
|
|
|
<!-- Commit SHA -->
|
|
|
|
<Border Grid.Column="2" ClipToBounds="True">
|
|
|
|
<TextBlock Classes="primary"
|
|
|
|
Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
|
|
|
|
HorizontalAlignment="Center"/>
|
|
|
|
</Border>
|
2024-08-27 06:28:48 -07:00
|
|
|
|
2024-11-29 03:00:53 -08:00
|
|
|
<!-- Commit Time -->
|
2024-11-29 03:12:27 -08:00
|
|
|
<Border Grid.Column="3" ClipToBounds="True">
|
|
|
|
<TextBlock Classes="primary" Text="{Binding Commit.CommitterTimeStr}" Margin="8,0"/>
|
|
|
|
</Border>
|
2024-11-29 03:00:53 -08:00
|
|
|
|
|
|
|
<!-- MoveUp Button -->
|
|
|
|
<Button Grid.Column="4" Classes="icon_button" Click="OnMoveItemUp" ToolTip.Tip="Alt+Up">
|
|
|
|
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Up}"/>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<!-- MoveDown Button -->
|
|
|
|
<Button Grid.Column="5" Classes="icon_button" Click="OnMoveItemDown" ToolTip.Tip="Alt+Down">
|
|
|
|
<Path Width="14" Height="14" Margin="0,4,0,0" Data="{StaticResource Icons.Down}"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
2024-08-27 06:28:48 -07:00
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListBox.ItemTemplate>
|
2024-10-11 19:28:54 -07:00
|
|
|
</v:InteractiveRebaseListBox>
|
2024-06-20 02:02:12 -07:00
|
|
|
|
|
|
|
<v:LoadingIcon Grid.Row="0" Width="48" Height="48" HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding IsLoading}"/>
|
|
|
|
|
|
|
|
<GridSplitter Grid.Row="1"
|
|
|
|
MinHeight="1"
|
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
2024-06-20 02:32:14 -07:00
|
|
|
Background="Transparent"
|
|
|
|
BorderThickness="0,1,0,0"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border2}"/>
|
2024-06-20 02:02:12 -07:00
|
|
|
|
2024-07-29 00:07:41 -07:00
|
|
|
<Grid Grid.Row="2">
|
2024-06-20 02:02:12 -07:00
|
|
|
<Path Width="128" Height="128"
|
|
|
|
Data="{StaticResource Icons.Detail}"
|
|
|
|
HorizontalAlignment="Center"
|
2024-07-29 00:07:41 -07:00
|
|
|
Fill="{DynamicResource Brush.FG2}"
|
|
|
|
IsVisible="{Binding SelectedItem, Converter={x:Static ObjectConverters.IsNull}}"/>
|
|
|
|
|
|
|
|
<ContentControl Content="{Binding DetailContext}" IsVisible="{Binding SelectedItem, Converter={x:Static ObjectConverters.IsNotNull}}">
|
2024-06-20 02:02:12 -07:00
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="vm:CommitDetail">
|
|
|
|
<v:CommitDetail/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<!-- Options -->
|
|
|
|
<Grid Grid.Row="3" ColumnDefinitions="*,Auto,Auto" Margin="8,0,8,8">
|
|
|
|
<ProgressBar x:Name="Running"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0,0,32,0"
|
|
|
|
Background="{DynamicResource Brush.FG2}"
|
|
|
|
Foreground="{DynamicResource Brush.Accent}"
|
|
|
|
Minimum="0"
|
|
|
|
Maximum="100"
|
|
|
|
IsVisible="False"/>
|
|
|
|
<Button Grid.Column="1" Classes="flat primary" MinWidth="80" Content="{DynamicResource Text.Start}" Click="StartJobs"/>
|
2024-06-22 04:35:15 -07:00
|
|
|
<Button Grid.Column="2" Classes="flat" Margin="8,0,0,0" MinWidth="80" Content="{DynamicResource Text.Cancel}" Click="CloseWindow"/>
|
2024-06-20 02:02:12 -07:00
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</v:ChromelessWindow>
|