diff --git a/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs b/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs index 04dd76a..f6b3c9c 100644 --- a/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs +++ b/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs @@ -82,6 +82,8 @@ public ParamsPanel Create(ScriptConfig action, Dictionary values }; generateButton.Click += async(sender, args) => { + generateButton.IsEnabled = false; + generateButton.Classes.Add("spinning"); var result = await commandExecutor($"Generate parameter for '{param.Name}'", param.ValueGeneratorCommand); Dispatcher.UIThread.Post(() => { @@ -89,6 +91,8 @@ public ParamsPanel Create(ScriptConfig action, Dictionary values if (controlRecord is { Control: TextBox tb }) { tb.Text = result?.Trim() ?? string.Empty; + generateButton.Classes.Remove("spinning"); + generateButton.IsEnabled = true; } }); }; diff --git a/src/ScriptRunner/ScriptRunner.GUI/Themes/StyleClasses.axaml b/src/ScriptRunner/ScriptRunner.GUI/Themes/StyleClasses.axaml index 0250531..6472b82 100644 --- a/src/ScriptRunner/ScriptRunner.GUI/Themes/StyleClasses.axaml +++ b/src/ScriptRunner/ScriptRunner.GUI/Themes/StyleClasses.axaml @@ -1,6 +1,7 @@  + xmlns:views="clr-namespace:ScriptRunner.GUI.Views" + xmlns:tanker="https://github.com/projektanker/icons.avalonia"> @@ -120,5 +121,18 @@ - + \ No newline at end of file