[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)) {
|
if (ImGui::BeginPopupModal(m_title.c_str(), &m_open, modalFlags)) {
|
||||||
ImGui::Text("%s", m_question.c_str());
|
ImGui::Text("%s", m_question.c_str());
|
||||||
auto const r = PopupControlsOkCancel(m_open, "Yes", "No");
|
auto const r = PopupControlsOkCancel(m_open, "Yes", "No");
|
||||||
response.emit(r);
|
|
||||||
switch (r) {
|
switch (r) {
|
||||||
case PopupResponse::None:
|
case PopupResponse::None:
|
||||||
break;
|
break;
|
||||||
case PopupResponse::OK:
|
case PopupResponse::OK:
|
||||||
|
response.emit(r);
|
||||||
close();
|
close();
|
||||||
break;
|
break;
|
||||||
case PopupResponse::Cancel:
|
case PopupResponse::Cancel:
|
||||||
|
response.emit(r);
|
||||||
close();
|
close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user