mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Disabled: Fixed an issue restoring Alpha in EndDisabled() when using nested BeginDisabled() calls with PushStyleVar(ImGuiStyleVar_DisabledAlpha) within. (#8454, #7640)
This commit is contained in:
parent
71b160cdbb
commit
df31774327
3 changed files with 6 additions and 1 deletions
|
|
@ -103,6 +103,8 @@ Other changes:
|
|||
(#8451, #7660) [@achabense]
|
||||
- TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to
|
||||
handle UTF-8 regardless of system regional settings. (#7660) [@achabense]
|
||||
- Disabled: Fixed an issue restoring Alpha in EndDisabled() when using nested
|
||||
BeginDisabled() calls with PushStyleVar(ImGuiStyleVar_DisabledAlpha) within. (#8454, #7640)
|
||||
- Clipper: Fixed an issue where passing an out of bound index to IncludeItemByIndex()
|
||||
could incorrectly offset the final cursor, even if that index was not iterated through.
|
||||
One case where it would manifest was calling Combo() with an out of range index. (#8450)
|
||||
|
|
|
|||
|
|
@ -7084,6 +7084,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||
window_stack_data.Window = window;
|
||||
window_stack_data.ParentLastItemDataBackup = g.LastItemData;
|
||||
window_stack_data.DisabledOverrideReenable = (flags & ImGuiWindowFlags_Tooltip) && (g.CurrentItemFlags & ImGuiItemFlags_Disabled);
|
||||
window_stack_data.DisabledOverrideReenableAlphaBackup = 0.0f;
|
||||
ErrorRecoveryStoreState(&window_stack_data.StackSizesInBegin);
|
||||
g.StackSizesInBeginForCurrentWindow = &window_stack_data.StackSizesInBegin;
|
||||
if (flags & ImGuiWindowFlags_ChildMenu)
|
||||
|
|
@ -7950,6 +7951,7 @@ void ImGui::BeginDisabledOverrideReenable()
|
|||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(g.CurrentItemFlags & ImGuiItemFlags_Disabled);
|
||||
g.CurrentWindowStack.back().DisabledOverrideReenableAlphaBackup = g.Style.Alpha;
|
||||
g.Style.Alpha = g.DisabledAlphaBackup;
|
||||
g.CurrentItemFlags &= ~ImGuiItemFlags_Disabled;
|
||||
g.ItemFlagsStack.push_back(g.CurrentItemFlags);
|
||||
|
|
@ -7963,7 +7965,7 @@ void ImGui::EndDisabledOverrideReenable()
|
|||
IM_ASSERT(g.DisabledStackSize > 0);
|
||||
g.ItemFlagsStack.pop_back();
|
||||
g.CurrentItemFlags = g.ItemFlagsStack.back();
|
||||
g.Style.Alpha = g.DisabledAlphaBackup * g.Style.DisabledAlpha;
|
||||
g.Style.Alpha = g.CurrentWindowStack.back().DisabledOverrideReenableAlphaBackup;
|
||||
}
|
||||
|
||||
void ImGui::PushTextWrapPos(float wrap_pos_x)
|
||||
|
|
|
|||
|
|
@ -1316,6 +1316,7 @@ struct ImGuiWindowStackData
|
|||
ImGuiLastItemData ParentLastItemDataBackup;
|
||||
ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting
|
||||
bool DisabledOverrideReenable; // Non-child window override disabled flag
|
||||
float DisabledOverrideReenableAlphaBackup;
|
||||
};
|
||||
|
||||
struct ImGuiShrinkWidthItem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue