[studio] Fix QuestionPopup to only emit a response when there is a response
All checks were successful
Build / build (push) Successful in 3m36s
All checks were successful
Build / build (push) Successful in 3m36s
This commit is contained in:
parent
4e068d628c
commit
0abadc1850
@ -260,14 +260,15 @@ void QuestionPopup::draw(StudioContext &ctx, ImVec2 const &sz) noexcept {
|
||||
if (ImGui::BeginPopupModal(m_title.c_str(), &m_open, modalFlags)) {
|
||||
ImGui::Text("%s", m_question.c_str());
|
||||
auto const r = PopupControlsOkCancel(m_open, "Yes", "No");
|
||||
response.emit(r);
|
||||
switch (r) {
|
||||
case PopupResponse::None:
|
||||
break;
|
||||
case PopupResponse::OK:
|
||||
response.emit(r);
|
||||
close();
|
||||
break;
|
||||
case PopupResponse::Cancel:
|
||||
response.emit(r);
|
||||
close();
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user