From 4c1d051529ccbc4f9cc26be63241703dc49b0995 Mon Sep 17 00:00:00 2001 From: quou Date: Fri, 24 Jan 2025 00:38:04 +1100 Subject: UI label set_bool --- ui.cpp | 7 +++++++ ui.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/ui.cpp b/ui.cpp index 1e18fc0..8ef6c10 100644 --- a/ui.cpp +++ b/ui.cpp @@ -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: { diff --git a/ui.hpp b/ui.hpp index dbf6fb6..0ee811e 100644 --- a/ui.hpp +++ b/ui.hpp @@ -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 { -- cgit v1.2.3-54-g00ecf