use new action map API instead of ActionManager::get_action
[ardour.git] / gtk2_ardour / editor_selection.cc
index 0d5909778aff68b193fa75c60b8fd36952729788..227eaa4a63247da4d083976930b16885bdbd7850 100644 (file)
@@ -983,23 +983,6 @@ Editor::set_selected_regionview_from_map_event (GdkEventAny* /*ev*/, StreamView*
        return true;
 }
 
-struct SelectionOrderSorter {
-       bool operator() (TimeAxisView const * const a, TimeAxisView const * const b) const  {
-               boost::shared_ptr<Stripable> sa = a->stripable ();
-               boost::shared_ptr<Stripable> sb = b->stripable ();
-               if (!sa && !sb) {
-                       return a < b;
-               }
-               if (!sa) {
-                       return false;
-               }
-               if (!sb) {
-                       return true;
-               }
-               return sa->presentation_info().selection_cnt() < sb->presentation_info().selection_cnt();
-       }
-};
-
 void
 Editor::presentation_info_changed (PropertyChange const & what_changed)
 {
@@ -1588,8 +1571,20 @@ Editor::region_selection_changed ()
                }
        }
 
-       if ( _session->solo_selection_active() )
+       if (_session->solo_selection_active()) {
                play_solo_selection(false);
+       }
+
+       /* set nudge button color */
+       if (! get_regions_from_selection_and_entered().empty()) {
+               /* nudge regions */
+               nudge_forward_button.set_name ("nudge button");
+               nudge_backward_button.set_name ("nudge button");
+       } else {
+               /* nudge marker or playhead */
+               nudge_forward_button.set_name ("generic button");
+               nudge_backward_button.set_name ("generic button");
+       }
 }
 
 void