diff options
Diffstat (limited to 'src/saffron_button.c')
| -rw-r--r-- | src/saffron_button.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/saffron_button.c b/src/saffron_button.c index 0fdbd10..bef0018 100644 --- a/src/saffron_button.c +++ b/src/saffron_button.c @@ -5,7 +5,16 @@ static void saffron_button_draw(SaffronWidget* widget, SDL_Renderer* renderer) { SaffronButton* btn = (SaffronButton*)widget; - // waiting to finish saffrontheme first + SaffronTheme* theme = widget->theme; + if (!theme) return; + SaffronColor secondary = theme->secondary; + SaffronColor tertiary = theme->tertiary; + SDL_SetRenderDrawColor(renderer, secondary.r, secondary.g, secondary.b, secondary.a); + SDL_FRect rect = {widget->x, widget->y, widget->w, widget->h}; + SDL_RenderFillRect(renderer, &rect); + + SDL_SetRenderDrawColor(renderer, tertiary.r, tertiary.g, tertiary.b, tertiary.a); + SDL_RenderRect(renderer, &rect); } SaffronButton* saffron_button_new(bool enabled, void (*callback)(SaffronButton* self), int width, int height) { |
