Make sure that disabled buttons cannot be activated

This commit is contained in:
blankie 2023-03-08 08:40:18 +07:00
parent 451c57f198
commit 283b5e9f4d
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ bool ImGui::Button(const char* label, bool enabled) {
ImGui::BeginDisabled();
}
bool res = ImGui::Button(label);
bool res = ImGui::Button(label) && enabled;
if (!enabled) {
ImGui::EndDisabled();
@ -67,7 +67,7 @@ bool ImGui::ArrowButton(const char* label, ImGuiDir dir, bool enabled) {
ImGui::BeginDisabled();
}
bool res = ImGui::ArrowButton(label, dir);
bool res = ImGui::ArrowButton(label, dir) && enabled;
if (!enabled) {
ImGui::EndDisabled();