Fixed nested BeginDisabled()/EndDisabled() calls. (#211, #4452, #4453, #4462) [Legulysse]
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index f4d4a44..951f3f6 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -32,14 +32,21 @@
-----------------------------------------------------------------------
+ VERSION 1.84.2 (Released 2021-08-23)
+-----------------------------------------------------------------------
+
+Decorated log: https://github.com/ocornut/imgui/releases/tag/v1.84.2
+
+- Disabled: Fixed nested BeginDisabled()/EndDisabled() calls. (#211, #4452, #4453, #4462) [@Legulysse]
+
+
+-----------------------------------------------------------------------
VERSION 1.84.1 (Released 2021-08-20)
-----------------------------------------------------------------------
Decorated log: https://github.com/ocornut/imgui/releases/tag/v1.84.1
-Other Changes:
-
-- Fixed BeginDisabled(false) - BeginDisabled(true) was working. (#211, #4452, #4453)
+- Disabled: Fixed BeginDisabled(false) - BeginDisabled(true) was working. (#211, #4452, #4453)
-----------------------------------------------------------------------
diff --git a/imgui.cpp b/imgui.cpp
index 9139afe..ab27f13 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -6627,9 +6627,11 @@
{
ImGuiContext& g = *GImGui;
bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
- g.DisabledAlphaBackup = g.Style.Alpha;
if (!was_disabled && disabled)
+ {
+ g.DisabledAlphaBackup = g.Style.Alpha;
g.Style.Alpha *= g.Style.DisabledAlpha; // PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * g.Style.DisabledAlpha);
+ }
if (was_disabled || disabled)
g.CurrentItemFlags |= ImGuiItemFlags_Disabled;
g.ItemFlagsStack.push_back(g.CurrentItemFlags);
@@ -6641,7 +6643,7 @@
bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0;
//PopItemFlag();
g.ItemFlagsStack.pop_back();
- g.CurrentItemFlags &= ~ImGuiItemFlags_Disabled;
+ g.CurrentItemFlags = g.ItemFlagsStack.back();
if (was_disabled && (g.CurrentItemFlags & ImGuiItemFlags_Disabled) == 0)
g.Style.Alpha = g.DisabledAlphaBackup; //PopStyleVar();
}
diff --git a/imgui.h b/imgui.h
index c6132ab..b56cb85 100644
--- a/imgui.h
+++ b/imgui.h
@@ -60,8 +60,8 @@
// Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
-#define IMGUI_VERSION "1.84.1"
-#define IMGUI_VERSION_NUM 18404
+#define IMGUI_VERSION "1.84.2"
+#define IMGUI_VERSION_NUM 18405
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE