summaryrefslogtreecommitdiff
path: root/gtk2_ardour/location_ui.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-05-01 21:34:24 +0000
committerCarl Hetherington <carl@carlh.net>2012-05-01 21:34:24 +0000
commitae787813ddc37bdc2ba32fb8c190a8153b7c5c59 (patch)
tree7b7fe380d8668e18f1cbc9ce984f517817c7573a /gtk2_ardour/location_ui.cc
parent6b9d8be70742a1466256ba56b9a42a27bba1bc93 (diff)
Fix the focussing of newly-created marker name entries
when Config->get_name_new_markers() is true. git-svn-id: svn://localhost/ardour2/branches/3.0@12144 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/location_ui.cc')
-rw-r--r--gtk2_ardour/location_ui.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc
index 60e0be5676..4ef413aef7 100644
--- a/gtk2_ardour/location_ui.cc
+++ b/gtk2_ardour/location_ui.cc
@@ -687,8 +687,9 @@ LocationEditRow::position_lock_style_changed (ARDOUR::Location*)
}
void
-LocationEditRow::focus_name() {
- name_entry.grab_focus();
+LocationEditRow::focus_name()
+{
+ name_entry.grab_focus ();
}
void
@@ -862,9 +863,9 @@ LocationUI::location_redraw_ranges ()
}
struct LocationSortByStart {
- bool operator() (Location *a, Location *b) {
- return a->start() < b->start();
- }
+ bool operator() (Location *a, Location *b) {
+ return a->start() < b->start();
+ }
};
void
@@ -879,7 +880,7 @@ LocationUI::location_added (Location* location)
loc.sort (LocationSortByStart ());
LocationEditRow* erow = manage (new LocationEditRow (_session, location));
-
+
erow->set_clock_group (*_clock_group);
erow->remove_requested.connect (sigc::mem_fun (*this, &LocationUI::location_remove_requested));
@@ -910,6 +911,11 @@ LocationUI::location_added (Location* location)
range_rows.show_all ();
location_rows.show_all ();
+
+ if (location == newest_location) {
+ newest_location = 0;
+ erow->focus_name();
+ }
}
}
@@ -959,10 +965,6 @@ LocationUI::map_locations (Locations::LocationList& locations)
Box_Helpers::BoxList & loc_children = location_rows.children();
loc_children.push_back(Box_Helpers::Element(*erow, PACK_SHRINK, 1, PACK_START));
- if (location == newest_location) {
- newest_location = 0;
- erow->focus_name();
- }
} else if (location->is_auto_punch()) {
punch_edit_row.set_session (_session);
punch_edit_row.set_location (location);