Skip to content

Commit

Permalink
Fix im.disabled not calling EndDisabled in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Oct 9, 2024
1 parent 96b08fc commit 5a14351
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dev/src/imbind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ enum Nesting {
N_DRAG_DROP_SOURCE,
N_DRAG_DROP_TARGET,
N_TABLE,
N_DISABLED,
};

vector<Nesting> nstack;
Expand Down Expand Up @@ -218,6 +219,9 @@ void NPop(VM &vm, Nesting n) {
case N_TABLE:
ImGui::EndTable();
break;
case N_DISABLED:
ImGui::EndDisabled();
break;
}
// If this was indeed the item we're looking for, we can stop popping.
if (tn == n) break;
Expand Down Expand Up @@ -1566,13 +1570,14 @@ nfr("disabled_start", "disabled", "B", "",
IsInit(vm);
const auto disabled = Pop(sp).True();
ImGui::BeginDisabled(disabled);
NPush(N_DISABLED);
});

nfr("disabled_end", "", "", "",
"",
[](StackPtr &, VM &vm) {
IsInit(vm);
ImGui::EndDisabled();
NPop(vm, N_DISABLED);
});

nfr("button_repeat_start", "repeat", "B", "",
Expand Down

0 comments on commit 5a14351

Please sign in to comment.