Skip to content

Commit

Permalink
Fix BeginDisabled(false), again, (#211, #4452, #4453) Version 1.84b
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Aug 20, 2021
1 parent f969e68 commit b036137
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 12 deletions.
11 changes: 11 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ HOW TO UPDATE?
- Please report any issue!


-----------------------------------------------------------------------
VERSION 1.84b (Released 2021-08-20)
-----------------------------------------------------------------------

Decorated log: https://github.com/ocornut/imgui/releases/tag/v1.84b

Other Changes:

- Fixed BeginDisabled(false) - BeginDisabled(true) was working. (#211, #4452, #4453)


-----------------------------------------------------------------------
VERSION 1.84 (Released 2021-08-20)
-----------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (main code and documentation)

// Help:
Expand Down Expand Up @@ -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)
{
Expand All @@ -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);
}

Expand Down
7 changes: 4 additions & 3 deletions imgui.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (headers)

// Help:
Expand Down Expand Up @@ -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.84b"
#define IMGUI_VERSION_NUM 18402
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion imgui_demo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (demo code)

// Help:
Expand Down
2 changes: 1 addition & 1 deletion imgui_draw.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (drawing and font code)

/*
Expand Down
2 changes: 1 addition & 1 deletion imgui_internal.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (internal structures/api)

// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
Expand Down
2 changes: 1 addition & 1 deletion imgui_tables.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (tables and columns code)

/*
Expand Down
2 changes: 1 addition & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.84
// dear imgui, v1.84b
// (widgets code)

/*
Expand Down

0 comments on commit b036137

Please sign in to comment.