Mercurial > molko
diff src/libmlk-ui/ui/frame.c @ 409:6011ad866e99
ui: delete action functions
The handling of actions is done without taking care of the return value which
make it impossible to detect UI elements since it's a immediate mode like
implementation.
Users are encouraged to write code like instead:
```
if (button_handle(&b, &ev)) {
// Do something.
}
```
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 09 Sep 2022 09:27:17 +0200 |
parents | 460c78706989 |
children | 8f59201dc76b |
line wrap: on
line diff
--- a/src/libmlk-ui/ui/frame.c Fri Apr 08 15:59:08 2022 +0200 +++ b/src/libmlk-ui/ui/frame.c Fri Sep 09 09:27:17 2022 +0200 @@ -19,18 +19,11 @@ #include <assert.h> #include <string.h> -#include <core/action.h> #include <core/painter.h> #include "frame.h" #include "theme.h" -static void -draw(struct action *act) -{ - frame_draw(act->data); -} - void frame_draw_default(const struct theme *t, const struct frame *frame) { @@ -54,14 +47,3 @@ theme_draw_frame(frame->theme, frame); } - -void -frame_action(struct frame *frame, struct action *act) -{ - assert(frame); - assert(act); - - memset(act, 0, sizeof (*act)); - act->data = frame; - act->draw = draw; -}