summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-01-21 01:37:44 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2013-01-21 01:37:44 +0000
commita1d5d6f4440dda98e8fab29b9079d5997162637c (patch)
tree84d6067bb9eb84055328483d4df631b52b24d91e /gtk2_ardour/time_axis_view.cc
parent58d0fa72407fbb3c068147abf680c46f5abf14ab (diff)
make height of name_label and name_entry the same to avoid button wierdness while track name editing; fix crash caused by nested calls to end_name_edit()
git-svn-id: svn://localhost/ardour2/branches/3.0@13936 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r--gtk2_ardour/time_axis_view.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 7461035a78..7bbf5caa60 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -112,7 +112,13 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
name_label.set_name ("TrackLabel");
name_label.set_alignment (0.0, 0.5);
ARDOUR_UI::instance()->set_tip (name_label, _("Track/Bus name (double click to edit)"));
-
+
+ Gtk::Entry* an_entry = new Gtk::Entry;
+ Gtk::Requisition req;
+ an_entry->size_request (req);
+ name_label.set_size_request (-1, req.height);
+ delete an_entry;
+
name_hbox.pack_start (name_label, true, true);
name_hbox.show ();
name_label.show ();
@@ -641,9 +647,16 @@ TimeAxisView::end_name_edit (int response)
edit_next = true;
}
- /* this will delete the name_entry */
- name_hbox.remove (*name_entry);
+ /* this will delete the name_entry. but it will also drop focus, which
+ * will cause another callback to this function, so set name_entry = 0
+ * first to ensure we don't double-remove etc. etc.
+ */
+
+ Gtk::Entry* tmp = name_entry;
name_entry = 0;
+ name_hbox.remove (*tmp);
+
+ /* put the name label back */
name_hbox.pack_start (name_label);
name_label.show ();