From a52e18c7e8cc9e4869c95ce14cf29a280aa1ec3f Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 27 Aug 2014 11:53:53 -0500 Subject: use ArdourButtons on the automation time axis --- gtk2_ardour/automation_time_axis.cc | 23 +++++++++++++---------- gtk2_ardour/automation_time_axis.h | 7 +++++-- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 3b00fc69b6..c859a41c84 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -127,10 +127,10 @@ AutomationTimeAxisView::AutomationTimeAxisView ( _base_rect->lower_to_bottom(); } - hide_button.add (*(manage (new Gtk::Image (::get_icon("hide"))))); + hide_button.set_image ( ::get_icon(X_("hide"))); - auto_button.set_name ("TrackVisualButton"); - hide_button.set_name ("TrackRemoveButton"); + auto_button.set_name ("mixer strip button"); + hide_button.set_name ("mixer strip button"); auto_button.unset_flags (Gtk::CAN_FOCUS); hide_button.unset_flags (Gtk::CAN_FOCUS); @@ -147,6 +147,9 @@ AutomationTimeAxisView::AutomationTimeAxisView ( set_height (preset_height (HeightNormal)); } + //name label isn't editable on an automation track; remove the tooltip + ARDOUR_UI::instance()->set_tip (name_label, X_("")); + /* repack the name label */ if (name_label.get_parent()) { @@ -182,8 +185,8 @@ AutomationTimeAxisView::AutomationTimeAxisView ( controls_table.show_all (); - hide_button.signal_clicked().connect (sigc::mem_fun(*this, &AutomationTimeAxisView::hide_clicked)); - auto_button.signal_clicked().connect (sigc::mem_fun(*this, &AutomationTimeAxisView::auto_clicked)); + hide_button.signal_clicked.connect (sigc::mem_fun(*this, &AutomationTimeAxisView::hide_clicked)); + auto_button.signal_clicked.connect (sigc::mem_fun(*this, &AutomationTimeAxisView::auto_clicked)); controls_base_selected_name = X_("AutomationTrackControlsBaseSelected"); controls_base_unselected_name = X_("AutomationTrackControlsBase"); @@ -298,7 +301,7 @@ AutomationTimeAxisView::automation_state_changed () switch (state & (ARDOUR::Off|Play|Touch|Write)) { case ARDOUR::Off: - auto_button.set_label (S_("Automation|Manual")); + auto_button.set_text (S_("Automation|Manual")); if (auto_off_item) { ignore_state_request = true; auto_off_item->set_active (true); @@ -309,7 +312,7 @@ AutomationTimeAxisView::automation_state_changed () } break; case Play: - auto_button.set_label (_("Play")); + auto_button.set_text (_("Play")); if (auto_play_item) { ignore_state_request = true; auto_play_item->set_active (true); @@ -320,7 +323,7 @@ AutomationTimeAxisView::automation_state_changed () } break; case Write: - auto_button.set_label (_("Write")); + auto_button.set_text (_("Write")); if (auto_write_item) { ignore_state_request = true; auto_write_item->set_active (true); @@ -331,7 +334,7 @@ AutomationTimeAxisView::automation_state_changed () } break; case Touch: - auto_button.set_label (_("Touch")); + auto_button.set_text (_("Touch")); if (auto_touch_item) { ignore_state_request = true; auto_touch_item->set_active (true); @@ -342,7 +345,7 @@ AutomationTimeAxisView::automation_state_changed () } break; default: - auto_button.set_label (_("???")); + auto_button.set_text (_("???")); break; } } diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index c169cb59d0..a468c12459 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -34,6 +34,7 @@ #include "time_axis_view.h" #include "automation_controller.h" +#include "ardour_button.h" namespace ARDOUR { class Session; @@ -143,8 +144,8 @@ class AutomationTimeAxisView : public TimeAxisView { bool ignore_toggle; bool first_call_to_set_height; - Gtk::Button hide_button; - Gtk::Button auto_button; + ArdourButton hide_button; + ArdourButton auto_button; Gtk::Menu* automation_menu; Gtk::Label* plugname; bool plugname_packed; @@ -165,6 +166,8 @@ class AutomationTimeAxisView : public TimeAxisView { void hide_clicked (); void auto_clicked (); + virtual bool can_edit_name() const {return false;} + void build_display_menu (); void cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp); -- cgit v1.2.3