From 283b5e9f4d539e63c42664eea9cd66192cdf9f41 Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 8 Mar 2023 08:40:18 +0700 Subject: [PATCH] Make sure that disabled buttons cannot be activated --- misc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc.cpp b/misc.cpp index b4abe61..9a8d43b 100644 --- a/misc.cpp +++ b/misc.cpp @@ -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();