SaveTool: add a wrapper over ImGui::Checkbox().

This way, I can make it work like radio buttons or selectables.
This commit is contained in:
Guillaume Jacquemin 2022-12-01 23:41:34 +01:00
parent aff84ccc96
commit da6aea3661
2 changed files with 6 additions and 0 deletions

View file

@ -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);
}

View file

@ -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<typename Functor, typename... Args>
auto drawUnsafeWidget(Functor func, Args... args) -> bool {