From 44ea8cb04aebafa8ae2ed2120ecf964567ff5eba Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 2 Jul 2025 11:24:45 +0800 Subject: [PATCH] ux: re-design custom action control editor Signed-off-by: leo --- .../ConfigureCustomActionControls.cs | 7 +- src/Views/ConfigureCustomActionControls.axaml | 82 ++++++++++--------- src/Views/Preferences.axaml | 5 +- src/Views/RepositoryConfigure.axaml | 5 +- 4 files changed, 56 insertions(+), 43 deletions(-) diff --git a/src/ViewModels/ConfigureCustomActionControls.cs b/src/ViewModels/ConfigureCustomActionControls.cs index f0588af7..abe992ea 100644 --- a/src/ViewModels/ConfigureCustomActionControls.cs +++ b/src/ViewModels/ConfigureCustomActionControls.cs @@ -23,7 +23,12 @@ namespace SourceGit.ViewModels public void Add() { - var added = new Models.CustomActionControl() { Type = Models.CustomActionControlType.TextBox }; + var added = new Models.CustomActionControl() + { + Label = "Unnamed", + Type = Models.CustomActionControlType.TextBox + }; + Controls.Add(added); Edit = added; } diff --git a/src/Views/ConfigureCustomActionControls.axaml b/src/Views/ConfigureCustomActionControls.axaml index 5e40a5a8..602915e4 100644 --- a/src/Views/ConfigureCustomActionControls.axaml +++ b/src/Views/ConfigureCustomActionControls.axaml @@ -129,7 +129,7 @@ - + @@ -146,24 +146,33 @@ Text="{DynamicResource Text.ConfigureCustomActionControls.Description.Tip}" Foreground="{DynamicResource Brush.FG2}"/> - + + IsVisible="{Binding Type, Converter={x:Static ObjectConverters.Equal}, ConverterParameter={x:Static m:CustomActionControlType.CheckBox}}"/> + + + + + + + + + + + + - - + @@ -171,6 +180,16 @@ + + - - - - - - - - - + Text="{DynamicResource Text.Configure.CustomAction.Arguments.Tip}" + Foreground="{DynamicResource Brush.FG2}"> + + + + + + + diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 275f72e7..bf5c2902 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -664,7 +664,10 @@ diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index 75cccd71..c3fd68f1 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -492,7 +492,10 @@