diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-27 14:08:38 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-27 14:08:38 +0000 |
commit | 4481cca74a6003cdcc982e5677adcbbdbf1e617d (patch) | |
tree | f2e605ca9fdbb8416115664114805b4991c64e5a | |
parent | 3b8b088bd8ee5864fb12a279b9ed607712db2b0e (diff) |
do not start editing track/bus names on a single click in the name entry of the track header - require double click; show name label rather than name entry when rec-enabled, to allow using the name area for track selection (name entry would have been visually still available for editing, which is misleading
git-svn-id: svn://localhost/ardour2/branches/3.0@13738 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 23 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 8 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 24 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.h | 2 |
5 files changed, 49 insertions, 18 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index a8f6782262..2c9f61b718 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -246,7 +246,8 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt) /* pick up the correct freeze state */ map_frozen (); - } + + } _editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit)); _editor.HorizontalPositionChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::horizontal_position_changed)); @@ -263,9 +264,6 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt) gm.get_gain_slider().set_name ("GainFader"); gm.get_level_meter().signal_scroll_event().connect (sigc::mem_fun (*this, &RouteTimeAxisView::controls_ebox_scroll), false); - - show_name_entry (); - hide_name_label (); } RouteTimeAxisView::~RouteTimeAxisView () @@ -2174,11 +2172,26 @@ RouteTimeAxisView::reset_processor_automation_curves () } } +bool +RouteTimeAxisView::can_edit_name () const +{ + /* we do not allow track name changes if it is record enabled + */ + return !_route->record_enabled(); +} + void RouteTimeAxisView::update_rec_display () { RouteUI::update_rec_display (); - name_entry.set_sensitive (!_route->record_enabled()); + + if (_route->record_enabled()) { + hide_name_entry (); + show_name_label (); + } else { + hide_name_label (); + show_name_entry (); + } } void diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index cab1ad940b..541b070558 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -232,20 +232,14 @@ protected: virtual void hide_all_automation (bool apply_to_selection = false); void timestretch (framepos_t start, framepos_t end); - void speed_changed (); - void map_frozen (); - void color_handler (); - void region_view_added (RegionView*); - void create_gain_automation_child (const Evoral::Parameter &, bool); - void setup_processor_menu_and_curves (); - void route_color_changed (); + bool can_edit_name() const; boost::shared_ptr<AutomationTimeAxisView> gain_track; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 94e7d83d19..6898f81bc4 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -229,14 +229,18 @@ RouteUI::set_route (boost::shared_ptr<Route> rp) rec_enable_button->show(); rec_enable_button->set_controllable (t->rec_enable_control()); - update_rec_display (); - if (is_midi_track()) { midi_track()->StepEditStatusChange.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::step_edit_changed, this, _1), gui_context()); } - } + } + + /* this will work for busses and tracks, and needs to be called to + set up the name entry/name label display. + */ + + update_rec_display (); if (is_track()) { boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route); diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 6f3d0c17bd..93435af953 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -112,8 +112,8 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie */ name_entry.set_name ("EditorTrackNameDisplay"); - name_entry.signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_release)); - name_entry.signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_press)); + name_entry.signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_release), false); + name_entry.signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_press), false); name_entry.signal_key_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_key_release)); name_entry.signal_activate().connect (sigc::mem_fun(*this, &TimeAxisView::name_entry_activated)); name_entry.signal_focus_in_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_focus_in)); @@ -683,12 +683,30 @@ TimeAxisView::name_entry_changed () } bool +TimeAxisView::can_edit_name () const +{ + return true; +} + +bool TimeAxisView::name_entry_button_press (GdkEventButton *ev) { if (ev->button == 3) { return true; } - return false; + + if (ev->button == 1) { + if (ev->type == GDK_2BUTTON_PRESS) { + if (can_edit_name()) { + name_entry.grab_focus (); + name_entry.start_editing ((GdkEvent*) ev); + } + } else { + conditionally_add_to_selection (); + } + } + + return true; } bool diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 5966d78ed8..26da869ee5 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -214,6 +214,8 @@ class TimeAxisView : public virtual AxisView std::string controls_base_unselected_name; std::string controls_base_selected_name; + virtual bool can_edit_name() const; + bool name_entry_button_press (GdkEventButton *ev); bool name_entry_button_release (GdkEventButton *ev); bool name_entry_key_release (GdkEventKey *ev); |