Consistently setup tooltips, prefer actions over buttons

ArdourButton::set_related_action() uses and subscribes to
tooltips from actions.

Explicitly calls to Gtkmm2ext::UI::instance()->set_tip will
have to be done after set_related_action and be overridden
when the action's tooltip changes.
This commit is contained in:
Robin Gareus 2025-02-26 19:30:50 +01:00
parent cdb7c8c4d1
commit d6f67db737
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 17 additions and 8 deletions

View file

@ -350,20 +350,12 @@ ApplicationBar::on_parent_changed (Gtk::Widget*)
monitor_button_size_group->add_widget (_monitor_mute_button);
/* tooltips */
Gtkmm2ext::UI::instance()->set_tip (_punch_in_button, _("Start recording at auto-punch start"));
Gtkmm2ext::UI::instance()->set_tip (_punch_out_button, _("Stop recording at auto-punch end"));
Gtkmm2ext::UI::instance()->set_tip (_record_mode_selector, _("<b>Layered</b>, new recordings will be added as regions on a layer atop existing regions.\n<b>SoundOnSound</b>, behaves like <i>Layered</i>, except underlying regions will be audible.\n<b>Non Layered</b>, the underlying region will be spliced and replaced with the newly recorded region."));
Gtkmm2ext::UI::instance()->set_tip (_latency_disable_button, _("Disable all Plugin Delay Compensation. This results in the shortest delay from live input to output, but any paths with delay-causing plugins will sound later than those without."));
Gtkmm2ext::UI::instance()->set_tip (_auto_return_button, _("Return to last playback start when stopped"));
Gtkmm2ext::UI::instance()->set_tip (_follow_edits_button, _("Playhead follows Range tool clicks, and Range selections"));
Gtkmm2ext::UI::instance()->set_tip (_primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
Gtkmm2ext::UI::instance()->set_tip (_secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
Gtkmm2ext::UI::instance()->set_tip (_solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
Gtkmm2ext::UI::instance()->set_tip (_auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
Gtkmm2ext::UI::instance()->set_tip (_feedback_alert_button, _("When lit, there is a ports connection issue, leading to feedback loop or ambiguous alignment.\nThis is caused by connecting an output back to some input (feedback), or by multiple connections from a source to the same output via different paths (ambiguous latency, record alignment)."));
Gtkmm2ext::UI::instance()->set_tip (_monitor_dim_button, _("Monitor section dim output"));
Gtkmm2ext::UI::instance()->set_tip (_monitor_mono_button, _("Monitor section mono output"));
Gtkmm2ext::UI::instance()->set_tip (_monitor_mute_button, _("Monitor section mute output"));
Gtkmm2ext::UI::instance()->set_tip (_cue_rec_enable, _("<b>When enabled</b>, triggering Cues will result in Cue Markers added to the timeline"));
Gtkmm2ext::UI::instance()->set_tip (_cue_play_enable, _("<b>When enabled</b>, Cue Markers will trigger the associated Cue when passed on the timeline"));
Gtkmm2ext::UI::instance()->set_tip (_editor_meter_peak_display, _("Reset All Peak Meters"));

View file

@ -640,6 +640,7 @@ private:
void set_session (ARDOUR::Session *);
void connect_dependents_to_session (ARDOUR::Session *);
void we_have_dependents ();
void setup_action_tooltips ();
void setup_session_options ();

View file

@ -88,6 +88,8 @@ ARDOUR_UI::we_have_dependents ()
StepEntry::setup_actions_and_bindings ();
ClipEditorBox::init ();
setup_action_tooltips ();
/* Global, editor, mixer, processor box actions are defined now. Link
them with any bindings, so that GTK does not get a chance to define
the GTK accel map entries first when we ask the GtkUIManager to

View file

@ -787,6 +787,20 @@ ARDOUR_UI::install_dependent_actions ()
ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalMixer"), _("Maximise Mixer Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_space));
}
void
ARDOUR_UI::setup_action_tooltips ()
{
ActionManager::get_action ("Transport", "TogglePunchIn")->set_tooltip (_("Start recording at auto-punch start"));
ActionManager::get_action ("Transport", "TogglePunchOut")->set_tooltip (_("Stop recording at auto-punch end"));
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_tooltip (_("Return to last playback start when stopped"));
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_tooltip (_("Playhead follows Range tool clicks, and Range selections"));
ActionManager::get_action (X_("Main"), X_("cancel-solo"))->set_tooltip (_("When active, something is soloed.\nClick to de-solo everything"));
ActionManager::get_action (X_("Monitor Section"), X_("monitor-dim-all"))->set_tooltip (_("Monitor section dim output"));
ActionManager::get_action (X_("Monitor Section"), X_("monitor-mono"))->set_tooltip (_("Monitor section mono output"));
ActionManager::get_action (X_("Monitor Section"), X_("monitor-cut-all"))->set_tooltip (_("Monitor section mute output"));
}
void
ARDOUR_UI::build_menu_bar ()
{