summaryrefslogtreecommitdiff
path: root/ui.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-01-24 00:37:53 +1100
committerquou <quou@disroot.org>2025-01-24 00:37:53 +1100
commitc0dc2dbcd26ca307bd7985c8626a2a1425a961fa (patch)
tree97c5466d22b79ade317d409ba19f1ca6e2e54a81 /ui.hpp
parent3afcec1798977d3309a5359b56b9534d87e70b6b (diff)
UI checkbox
Diffstat (limited to 'ui.hpp')
-rw-r--r--ui.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/ui.hpp b/ui.hpp
index 576f7a0..dbf6fb6 100644
--- a/ui.hpp
+++ b/ui.hpp
@@ -117,7 +117,8 @@ struct UI {
input_changed,
input_finalised,
text_typed,
- text_backspaced
+ text_backspaced,
+ checkbox_changed
} type;
void* payload;
};
@@ -201,6 +202,15 @@ struct UI {
void on_render() override;
};
+ struct Checkbox : Element {
+ Label* label;
+ Button* btn;
+ bool val;
+ Checkbox(UI* ui, Element* parent, const char* text);
+ Rect layout(const Rect& avail) override;
+ void set_val(bool v);
+ };
+
typedef int (*Input_Filter)(char ch);
struct Input : Element {