some small optimizations for track-selection process

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2584 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-11-02 17:28:39 +00:00
parent cb534fd536
commit 2ca6100c11
3 changed files with 11 additions and 15 deletions

View file

@ -201,7 +201,6 @@ Editor::typed_event (ArdourCanvas::Item* item, GdkEvent *event, ItemType type)
default:
break;
}
return ret;
}

View file

@ -651,16 +651,10 @@ Editor::track_selection_changed ()
}
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->set_selected (false);
if (mouse_mode == MouseRange) {
(*i)->hide_selection ();
}
}
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
(*i)->set_selected (true);
if (mouse_mode == MouseRange) {
(*i)->show_selection (selection->time);
if (find (selection->tracks.begin(), selection->tracks.end(), *i) != selection->tracks.end()) {
(*i)->set_selected (true);
} else {
(*i)->set_selected (false);
}
}
}
@ -687,6 +681,7 @@ Editor::time_selection_changed ()
} else {
ActionManager::set_sensitive (ActionManager::time_selection_sensitive_actions, true);
}
}
void

View file

@ -546,12 +546,16 @@ TimeAxisView::popup_size_menu (guint32 when)
void
TimeAxisView::set_selected (bool yn)
{
AxisView::set_selected (yn);
if (yn == _selected) {
return;
}
Selectable::set_selected (yn);
if (_selected) {
controls_ebox.set_name (controls_base_selected_name);
controls_frame.set_name (controls_base_selected_name);
/* propagate any existing selection, if the mode is right */
if (editor.current_mouse_mode() == Editing::MouseRange && !editor.get_selection().time.empty()) {
@ -572,8 +576,6 @@ TimeAxisView::set_selected (bool yn)
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
(*i)->set_selected (false);
}
}
}