diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 237a112f2a26..f4d4a4476ebf 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -31,6 +31,17 @@ HOW TO UPDATE? - Please report any issue! +----------------------------------------------------------------------- + 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) + + ----------------------------------------------------------------------- VERSION 1.84 (Released 2021-08-20) ----------------------------------------------------------------------- diff --git a/imgui.cpp b/imgui.cpp index 78030ef0e3a3..9139afeefdcb 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6621,7 +6621,7 @@ void ImGui::PopItemFlag() // - Those can be nested but this cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep things disabled) // - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently. // - Feedback welcome at https://github.com/ocornut/imgui/issues/211 -// - BeginDisabled(false) essentially does nothing but is provided to facilitate use of boolean expressions +// - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it. // - Optimized shortcuts instead of PushStyleVar() + PushItemFlag() void ImGui::BeginDisabled(bool disabled) { @@ -6630,8 +6630,8 @@ void ImGui::BeginDisabled(bool disabled) g.DisabledAlphaBackup = g.Style.Alpha; if (!was_disabled && disabled) g.Style.Alpha *= g.Style.DisabledAlpha; // PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * g.Style.DisabledAlpha); - //PushItemFlag(ImGuiItemFlags_Disabled, was_disabled || disabled); - g.CurrentItemFlags |= ImGuiItemFlags_Disabled; + if (was_disabled || disabled) + g.CurrentItemFlags |= ImGuiItemFlags_Disabled; g.ItemFlagsStack.push_back(g.CurrentItemFlags); } diff --git a/imgui.h b/imgui.h index 1df673a30a7a..4b7c973bdbbf 100644 --- a/imgui.h +++ b/imgui.h @@ -60,8 +60,8 @@ Index of this file: // 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" -#define IMGUI_VERSION_NUM 18401 +#define IMGUI_VERSION "1.84.1" +#define IMGUI_VERSION_NUM 18403 #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_HAS_TABLE @@ -801,6 +801,7 @@ namespace ImGui // Disabling [BETA API] // - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors) + // - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it. IMGUI_API void BeginDisabled(bool disabled = true); IMGUI_API void EndDisabled();