From da6aea3661623adf3930d1b66e309737d532b9f8 Mon Sep 17 00:00:00 2001 From: William JCM Date: Thu, 1 Dec 2022 23:41:34 +0100 Subject: [PATCH] SaveTool: add a wrapper over ImGui::Checkbox(). This way, I can make it work like radio buttons or selectables. --- src/SaveTool/SaveTool.cpp | 5 +++++ src/SaveTool/SaveTool.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/SaveTool/SaveTool.cpp b/src/SaveTool/SaveTool.cpp index c9e2315..4c6356c 100644 --- a/src/SaveTool/SaveTool.cpp +++ b/src/SaveTool/SaveTool.cpp @@ -412,6 +412,11 @@ void SaveTool::drawTooltip(Containers::StringView text, Float wrap_pos) { } } +bool +SaveTool::drawCheckbox(Containers::StringView label, bool value) { + return ImGui::Checkbox(label.data(), &value); +} + void SaveTool::openUri(Containers::StringView uri) { ShellExecuteW(nullptr, nullptr, Utility::Unicode::widen(uri.data()), nullptr, nullptr, SW_SHOWDEFAULT); } diff --git a/src/SaveTool/SaveTool.h b/src/SaveTool/SaveTool.h index c662203..6d21401 100644 --- a/src/SaveTool/SaveTool.h +++ b/src/SaveTool/SaveTool.h @@ -164,6 +164,7 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener // Convenience wrappers over ImGui stuff void drawHelpMarker(Containers::StringView text, Float wrap_pos = 0.0f); void drawTooltip(Containers::StringView text, Float wrap_pos = 0.0f); + bool drawCheckbox(Containers::StringView label, bool value); template auto drawUnsafeWidget(Functor func, Args... args) -> bool {