Make sure that disabled buttons cannot be activated
This commit is contained in:
parent
451c57f198
commit
283b5e9f4d
4
misc.cpp
4
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();
|
||||
|
|
Loading…
Reference in New Issue