[studio,nostalgia/gfx/studio] Cleanup
All checks were successful
Build / build (push) Successful in 1m14s
All checks were successful
Build / build (push) Successful in 1m14s
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user