From b6b95a1761a66f48c78d5fbb8b3aff58f561f0c4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 13 Jun 2020 00:58:32 +0200 Subject: [PATCH] Amend 87bb0953d5 (Action script button text) --- gtk2_ardour/ardour_ui_dependents.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index b5922aeab8..d28ae7c14e 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -437,6 +437,11 @@ ARDOUR_UI::action_script_changed (int i, const std::string& n) } else { action_script_call_btn[i].set_icon (0, 0); } + if (n.empty ()) { + action_script_call_btn[i].set_text (string_compose ("%1%2", std::hex, i+1)); + } else { + action_script_call_btn[i].set_text (n.substr(0,1)); + } } std::string const a = string_compose (X_("script-%1"), i + 1); @@ -446,12 +451,10 @@ ARDOUR_UI::action_script_changed (int i, const std::string& n) act->set_label (string_compose (_("Unset #%1"), i + 1)); act->set_tooltip (_("No action bound\nRight-click to assign")); act->set_sensitive (false); - action_script_call_btn[i].set_text (string_compose ("%1%2", std::hex, i+1)); } else { act->set_label (n); act->set_tooltip (string_compose (_("%1\n\nClick to run\nRight-click to re-assign\nShift+right-click to unassign"), n)); act->set_sensitive (true); - action_script_call_btn[i].set_text (n.substr(0,1)); } KeyEditor::UpdateBindings (); }