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 /gtk2_ardour/time_axis_view.cc | |
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
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 24 |
1 files changed, 21 insertions, 3 deletions
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 |