mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-28 23:54:59 +00:00
feature<WorkingCopy>: finish recent commit message picker
This commit is contained in:
parent
88b9b0fb2f
commit
b40ca42d73
6 changed files with 45 additions and 28 deletions
|
@ -1,12 +0,0 @@
|
|||
using Avalonia.Markup.Xaml;
|
||||
using System;
|
||||
|
||||
namespace SourceGit.Views {
|
||||
public class IntExtension : MarkupExtension {
|
||||
public int Value { get; set; }
|
||||
public IntExtension(int value) { this.Value = value; }
|
||||
public override object ProvideValue(IServiceProvider serviceProvider) {
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -446,7 +446,7 @@
|
|||
<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>
|
||||
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.NotEqual}" ConverterParameter="{v:Int 1}"/>
|
||||
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsOne}"/>
|
||||
</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}"/>
|
||||
|
|
|
@ -354,6 +354,7 @@
|
|||
<Button Grid.Column="0"
|
||||
Classes="icon_button"
|
||||
Width="14" Height="14"
|
||||
Click="OnOpenCommitMessagePicker"
|
||||
ToolTip.Tip="{DynamicResource Text.WorkingCopy.MessageHistories}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.List}"/>
|
||||
</Button>
|
||||
|
|
|
@ -384,5 +384,14 @@ namespace SourceGit.Views {
|
|||
if (change != null && !outs.Contains(change)) outs.Add(change);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnOpenCommitMessagePicker(object sender, RoutedEventArgs e) {
|
||||
if (sender is Button button && DataContext is ViewModels.WorkingCopy vm) {
|
||||
var menu = vm.CreateContextMenuForCommitMessages();
|
||||
menu.Placement = PlacementMode.TopEdgeAlignedLeft;
|
||||
menu.Open(button);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue