Disabled: Reworked 1.90.8 behavior of Begin() not inheriting current BeginDisabled() state. Only tooltip are clearing that state. (#211, #7640)

This commit is contained in:
ocornut
2024-07-01 14:32:11 +02:00
parent 67216910fb
commit dd5c30d2d7
4 changed files with 7 additions and 5 deletions
+1 -2
View File
@@ -889,12 +889,11 @@ static void ShowDemoWindowWidgets()
// Using ImGuiHoveredFlags_ForTooltip will pull flags from 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav',
// which default value include the ImGuiHoveredFlags_AllowWhenDisabled flag.
// As a result, Set
ImGui::BeginDisabled();
ImGui::Button("Disabled item", sz);
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip))
ImGui::SetTooltip("I am a a tooltip for a disabled item.");
ImGui::EndDisabled();
ImGui::TreePop();
}