diff options
author | quou <quou@disroot.org> | 2025-01-24 00:38:04 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-01-24 00:38:04 +1100 |
commit | 4c1d051529ccbc4f9cc26be63241703dc49b0995 (patch) | |
tree | 0542169ddc9231f5172502465cafd1388420cb42 | |
parent | c0dc2dbcd26ca307bd7985c8626a2a1425a961fa (diff) |
UI label set_bool
-rw-r--r-- | ui.cpp | 7 | ||||
-rw-r--r-- | ui.hpp | 1 |
2 files changed, 8 insertions, 0 deletions
@@ -1267,6 +1267,13 @@ void UI::Label::set_float(float v) { set_text(buf); } +void UI::Label::set_bool(bool v) { + if (v) + set_text("true"); + else + set_text("false"); +} + static int title_handler(UI::Modal* modal, const UI::Message& msg) { switch (msg.type) { case UI::Message::Type::activate: { @@ -194,6 +194,7 @@ struct UI { void set_int(int v); void set_hex(uint64_t v); void set_float(float v); + void set_bool(bool v); }; struct Button : Label { |