From 1deadc4ac7901e1bc8f2047df580e1c14d7a0144 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Fri, 15 Mar 2024 20:38:34 +0100 Subject: Start reworking draw_paint and add per-button line width --- src/button.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/button.h') diff --git a/src/button.h b/src/button.h index 7ebf435..57907b4 100644 --- a/src/button.h +++ b/src/button.h @@ -17,10 +17,12 @@ typedef void (* ButtonAction)(Button *btn); struct Button { bool simple; - int x_pad, y_pad; + int x_pad; + int y_pad; PangoAlignment align; Color color; Color line_color; + int line_width; Animation *anim; }; @@ -40,7 +42,7 @@ typedef struct { // NOTE: For the moment all button specific functions take a generic button // pointer and assert the right type, so the check should be done by the caller -Button *button_simple_create(PangoAlignment align, Color color, Color line_color); +Button *button_simple_create(PangoAlignment align, Color color); // Takes ownership of text void button_simple_set_text(Button *btn, char *text, Color text_color); @@ -51,7 +53,7 @@ void button_simple_set_action(Button *btn, ButtonAction action, gpointer data); ButtonAction button_simple_get_action(Button *btn); -Button *button_group_create(PangoAlignment align, Color color, Color line_color); +Button *button_group_create(PangoAlignment align, Color color); void button_group_append(Button *btn, Button *child); @@ -59,6 +61,8 @@ void button_set_padding(Button *btn, int x_pad, int y_pad); bool button_set_animation(Button *btn, Animation *anim); +void button_set_line(Button *btn, Color line_color, int line_width); + void button_destroy(Button *btn); #endif -- cgit v1.2.3