update selection rect color when track color changes
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 23 Sep 2016 18:52:23 +0000 (13:52 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:32 +0000 (14:59 -0500)
libs/surfaces/push2/mix.cc

index 8aa3cab5c4d169854b999b44aa37491ec21647ff..58e29fc87708569ba73038b995d4b5b3ed8174cb 100644 (file)
@@ -430,6 +430,18 @@ MixLayout::strip_vpot_touch (int n, bool touching)
 void
 MixLayout::stripable_property_change (PropertyChange const& what_changed, uint32_t which)
 {
+       if (what_changed.contains (Properties::color)) {
+               lower_backgrounds[which]->set_fill_color (stripable[which]->presentation_info().color());
+
+               if (stripable[which]->presentation_info().selected()) {
+                       lower_text[which]->set_fill_color (contrasting_text_color (stripable[which]->presentation_info().color()));
+                       /* might not be a MIDI track, in which case this will
+                          do nothing
+                       */
+                       p2.update_selection_color ();
+               }
+       }
+
        if (what_changed.contains (Properties::hidden)) {
                switch_bank (bank_start);
        }
@@ -655,7 +667,6 @@ MixLayout::button_select_release ()
        } else {
 
                if (p2.modifier_state() & Push2::ModShift) {
-                       std::cerr << "select prev\n";
                        /* select prev */
 
                        if (selected == 0) {
@@ -682,7 +693,6 @@ MixLayout::button_select_release ()
 
                } else {
 
-                       std::cerr << "select next\n";
                        /* select next */
 
                        if (selected == 7) {