some changes to ArdourButton to allow custom colors to be set (e.g. based on track...
[ardour.git] / gtk2_ardour / ardour_button.h
index fbb2b8b7fab84622d4a7826ba849066399cf521d..48aa056849f19be1a48c244a312557cc4c7cbb1a 100644 (file)
@@ -74,6 +74,8 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
        void set_text (const std::string&);
        void set_markup (const std::string&);
        void set_angle (const double);
+       void set_alignment (const float, const float);
+       void get_alignment (float& xa, float& ya) {xa = _xalign; ya = _yalign;};
 
        void set_led_left (bool yn);
        void set_distinct_led_click (bool yn);
@@ -93,6 +95,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
        bool on_button_release_event (GdkEventButton*);
 
        void set_image (const Glib::RefPtr<Gdk::Pixbuf>&);
+        void set_bg_colors (uint32_t color_active, uint32_t color_inactive);
 
   protected:
        void render (cairo_t *);
@@ -120,11 +123,21 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
        int   _corner_mask;
 
        double _angle;
+       float _xalign, _yalign;
 
        uint32_t bg_color;
        uint32_t border_color;
-       uint32_t fill_color_active;
-       uint32_t fill_color_inactive;
+
+        uint32_t fill_color_active;
+        uint32_t fill_color_active_start;
+       uint32_t fill_color_active_end;
+        uint32_t fill_color_inactive_start;
+       uint32_t fill_color_inactive_end;
+        uint32_t text_color_inactive;
+        uint32_t text_color_active;
+        uint32_t led_color_inactive;
+       uint32_t led_color_active;
+
        cairo_pattern_t* fill_pattern;
        cairo_pattern_t* fill_pattern_active;
        cairo_pattern_t* shine_pattern;
@@ -153,11 +166,12 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
        bool _fixed_diameter;
        bool _distinct_led_click;
        bool _hovering;
-
+    
        static bool _flat_buttons;
 
        void setup_led_rect ();
        void set_colors ();
+        void build_patterns ();
        void color_handler ();
 
        void action_toggled ();