[studio,nostalgia/gfx/studio] Cleanup
All checks were successful
Build / build (push) Successful in 1m14s

This commit is contained in:
2025-05-06 01:00:04 -05:00
parent 8c6b2234ec
commit 0003454311
12 changed files with 55 additions and 43 deletions

View File

@@ -25,7 +25,7 @@ class Popup: public Widget {
// emits path parameter
ox::Signal<ox::Error(ox::String const&)> finished;
virtual ~Popup() noexcept = default;
~Popup() noexcept override = default;
virtual void open() noexcept = 0;

View File

@@ -82,6 +82,25 @@ PopupResponse PopupControlsOkCancel(
return PopupControlsOkCancel(ImGui::GetContentRegionAvail().x + 17, popupOpen, ok, cancel);
}
PopupResponse PopupControlsOk(
bool &popupOpen,
ox::CStringViewCR ok) {
auto out = PopupResponse::None;
constexpr auto btnSz = ImVec2{50, BtnSz.y};
ImGui::Separator();
ImGui::SetCursorPosX(ImGui::GetContentRegionAvail().x - 101);
if (ImGui::Button(ok.c_str(), btnSz)) {
popupOpen = false;
out = PopupResponse::OK;
}
ImGui::SameLine();
if (ImGui::IsKeyDown(ImGuiKey_Escape)) {
popupOpen = false;
out = PopupResponse::Cancel;
}
return out;
}
bool BeginPopup(turbine::Context &ctx, ox::CStringViewCR popupName, bool &show, ImVec2 const&sz) {
constexpr auto modalFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
centerNextWindow(ctx);