summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-10-27 11:53:16 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-10-27 11:53:16 +0000
commit5005ba060ec93b08cb9cc4beabcfc7a5f7ef2f84 (patch)
tree6b8d3159023ee69155230b1a5108f5d5321fe2c2 /gtk2_ardour/ardour_button.h
parent892f3c361e1b6d22da7f38194ec42182c185b14e (diff)
provide control over precisely what aspects of an ArdourButton are rendered, and other button-related miscellany
git-svn-id: svn://localhost/ardour2/branches/3.0@10315 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_button.h')
-rw-r--r--gtk2_ardour/ardour_button.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h
index 6f41a4191a..b7e073af05 100644
--- a/gtk2_ardour/ardour_button.h
+++ b/gtk2_ardour/ardour_button.h
@@ -29,9 +29,24 @@
class ArdourButton : public CairoWidget, Gtk::Activatable
{
public:
- ArdourButton ();
+ enum Element {
+ Edge = 0x1,
+ Body = 0x2,
+ Text = 0x4,
+ Indicator = 0x8,
+ Image = 0x16
+ };
+
+ static Element default_elements;
+ static Element led_default_elements;
+
+ ArdourButton (Element e = default_elements);
virtual ~ArdourButton ();
+ void set_elements (Element);
+ Element elements() const { return _elements; }
+
+ void set_corner_radius (float);
void set_diameter (float);
void set_text (const std::string&);
@@ -40,16 +55,17 @@ class ArdourButton : public CairoWidget, Gtk::Activatable
void set_led_left (bool yn);
void set_distinct_led_click (bool yn);
- sigc::signal<void> signal_clicked;
+ sigc::signal<void> signal_led_clicked;
protected:
void render (cairo_t *);
void on_size_request (Gtk::Requisition* req);
- void on_realize ();
+ void on_size_allocate (Gtk::Allocation&);
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
private:
+ Element _elements;
Glib::RefPtr<Pango::Layout> _layout;
std::string _text;
int _text_width;
@@ -58,6 +74,7 @@ class ArdourButton : public CairoWidget, Gtk::Activatable
float _diameter;
bool _fixed_diameter;
bool _distinct_led_click;
+ float _corner_radius;
cairo_pattern_t* edge_pattern;
cairo_pattern_t* fill_pattern;