Change color of nudge-buttons depending on selection.
authorRobin Gareus <robin@gareus.org>
Thu, 4 Oct 2018 19:55:44 +0000 (21:55 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 4 Oct 2018 19:55:44 +0000 (21:55 +0200)
Experimental.
This indicates region selection:
  * nudge region(s): red
  * nudge playhead or marker(s): default gray

This does not indicate marker selection (nudge marker vs playhead),
nor does it change when primary-modifier is held (force playhead
nudge).

gtk2_ardour/editor_selection.cc

index 61699afe0989948752357f583ec084f08cb3324d..227eaa4a63247da4d083976930b16885bdbd7850 100644 (file)
@@ -1571,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