Skip to content

Commit

Permalink
Fix BeginDisabled(false), again, (#211, #4452, #4453) Version 1.84.1
Browse files Browse the repository at this point in the history
(forced pushed since our earlier versioning didn't sort correctly in github web)

# Conflicts:
#	docs/CHANGELOG.txt
  • Loading branch information
ocornut committed Aug 20, 2021
1 parent 2e01952 commit 47fb332
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
11 changes: 11 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ Other changes:
Note that Linux/Mac still have inconsistent support for multi-viewports. If you want to help see https://github.com/ocornut/imgui/issues/2117.


-----------------------------------------------------------------------
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)
-----------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7165,7 +7165,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)
{
Expand All @@ -7174,8 +7174,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);
}

Expand Down
5 changes: 3 additions & 2 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,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
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
Expand Down Expand Up @@ -831,6 +831,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();

Expand Down

0 comments on commit 47fb332

Please sign in to comment.