mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-22 10:55:00 +00:00
ux: re-design commit message input box
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
9ba0b595d9
commit
e9036b5fb9
4 changed files with 85 additions and 63 deletions
|
@ -56,6 +56,9 @@ namespace SourceGit.Views
|
|||
FromEditor,
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<bool> ShowAdvancedOptionsProperty =
|
||||
AvaloniaProperty.Register<CommitMessageTextBox, bool>(nameof(ShowAdvancedOptions), false);
|
||||
|
||||
public static readonly StyledProperty<string> TextProperty =
|
||||
AvaloniaProperty.Register<CommitMessageTextBox, string>(nameof(Text), string.Empty);
|
||||
|
||||
|
@ -65,6 +68,12 @@ namespace SourceGit.Views
|
|||
public static readonly StyledProperty<string> DescriptionProperty =
|
||||
AvaloniaProperty.Register<CommitMessageTextBox, string>(nameof(Description), string.Empty);
|
||||
|
||||
public bool ShowAdvancedOptions
|
||||
{
|
||||
get => GetValue(ShowAdvancedOptionsProperty);
|
||||
set => SetValue(ShowAdvancedOptionsProperty, value);
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => GetValue(TextProperty);
|
||||
|
@ -167,6 +176,29 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private void OnOpenOpenAIHelper(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.WorkingCopy vm && sender is Control control)
|
||||
{
|
||||
var menu = vm.CreateContextForOpenAI();
|
||||
menu?.Open(control);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenConventionalCommitHelper(object _, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new ConventionalCommitMessageBuilder()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue