Allow to un-set custom Ardour-button colors
authorRobin Gareus <robin@gareus.org>
Sun, 1 Sep 2019 14:57:48 +0000 (16:57 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 1 Sep 2019 14:57:48 +0000 (16:57 +0200)
libs/widgets/ardour_button.cc
libs/widgets/widgets/ardour_button.h

index 2ccded83c0af1b6d47a31c71ab4fcd766bb9160a..4c1ac05a93767589c565ae5b99972e51e3a2c3e4 100644 (file)
@@ -827,6 +827,16 @@ void ArdourButton::set_inactive_color (const uint32_t color)
        CairoWidget::set_dirty ();
 }
 
+void ArdourButton::reset_fixed_colors ()
+{
+       if (_fixed_colors_set == 0) {
+               return;
+       }
+       _fixed_colors_set = 0;
+       _update_colors = true;
+       CairoWidget::set_dirty ();
+}
+
 void
 ArdourButton::build_patterns ()
 {
@@ -1096,6 +1106,7 @@ ArdourButton::set_active_state (Gtkmm2ext::ActiveState s)
        bool changed = (_active_state != s);
        CairoWidget::set_active_state (s);
        if (changed) {
+               _update_colors = true;
                CairoWidget::set_dirty ();
        }
 }
index a7fc4a6b2dd0e3de6eb832e598da06c5217abc6b..0cbd61bb0dc3c6a2e8e05aadb863414b8ef2941f 100644 (file)
@@ -124,6 +124,7 @@ class LIBWIDGETS_API ArdourButton : public CairoWidget , public Gtkmm2ext::Activ
        void set_fixed_colors   (const uint32_t active_color, const uint32_t inactive_color);
        void set_active_color   (const uint32_t active_color);
        void set_inactive_color (const uint32_t inactive_color);
+       void reset_fixed_colors ();
 
        void set_fallthrough_to_parent(bool fall) { _fallthrough_to_parent = fall; }