1
0
mirror of synced 2024-11-12 10:10:53 +01:00

fix: Not being able to close certain modal popups with the close button on the title bar (#1659)

### Problem description
When the close button is clicked, `ImGui::BeginPopupModal()` sets the
bool passed into the second parameter (p_open) to false. However, the
closing logic did not take this into account, making it difficult to
actually close modal popups.

For example, closing the "Export pattern File" modal took several clicks
on the "X" button, now it closes instantly.

### Implementation description
I added an additional check for the `open` variable being `false` in the
logic that checks the closing condition.
This commit is contained in:
SparkyTD 2024-05-09 08:49:31 -07:00 committed by GitHub
parent 978fa17932
commit ea0cafa229
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -491,7 +491,7 @@ namespace hex {
ImGui::OpenPopup(name);
}
if (currPopup->shouldClose()) {
if (currPopup->shouldClose() || !open) {
log::debug("Closing popup '{}'", name);
positionSet = sizeSet = false;