diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-16 21:11:51 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-16 21:11:51 +0100 |
| commit | 7d8a85532b8ee97af9568443fd97e9701943b225 (patch) | |
| tree | 7184361d47d2856be20f21ebb256f97f0f61818f /src/button.c | |
| parent | 4794a57face4e6e521c8a60a120ebf00bbc8a94f (diff) | |
Add min and max button width
Diffstat (limited to 'src/button.c')
| -rw-r--r-- | src/button.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/button.c b/src/button.c index 3b61bd2..9d869dc 100644 --- a/src/button.c +++ b/src/button.c @@ -78,6 +78,14 @@ void button_set_line(Button *btn, Color line_color, int line_width) btn->line_width = line_width; } +void button_set_width(Button *btn, int max, int min) +{ + g_assert(max >= min); + g_assert(max >= 0 && min >= 0); + btn->max_width = max; + btn->min_width = min; +} + void button_destroy(Button *btn) { animation_destroy(btn->anim); |
