This commit is contained in:
parent
db5b735a5d
commit
ea6d21687b
@ -189,6 +189,7 @@ struct ImGuiTypingSelectRequest; // Storage for GetTypingSelectRequest() (aim
|
|||||||
struct ImGuiWindow; // Storage for one window
|
struct ImGuiWindow; // Storage for one window
|
||||||
struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
|
struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
|
||||||
struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
|
struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
|
||||||
|
struct ImGuiWindowStackData; // Storage for each window pushed into the stack
|
||||||
|
|
||||||
// Enumerations
|
// Enumerations
|
||||||
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
|
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
|
||||||
@ -1459,7 +1460,7 @@ struct IMGUI_API ImGuiErrorRecoveryState
|
|||||||
ImGuiErrorRecoveryState() { memset((void*)this, 0, sizeof(*this)); }
|
ImGuiErrorRecoveryState() { memset((void*)this, 0, sizeof(*this)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Data saved for each window pushed into the stack
|
// Storage for each window pushed into the stack.
|
||||||
struct ImGuiWindowStackData
|
struct ImGuiWindowStackData
|
||||||
{
|
{
|
||||||
ImGuiWindow* Window;
|
ImGuiWindow* Window;
|
||||||
@ -1467,6 +1468,7 @@ struct ImGuiWindowStackData
|
|||||||
ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting
|
ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting
|
||||||
bool DisabledOverrideReenable; // Non-child window override disabled flag
|
bool DisabledOverrideReenable; // Non-child window override disabled flag
|
||||||
float DisabledOverrideReenableAlphaBackup;
|
float DisabledOverrideReenableAlphaBackup;
|
||||||
|
ImRect ParentLastComboPreviewRect;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ImGuiShrinkWidthItem
|
struct ImGuiShrinkWidthItem
|
||||||
@ -3538,7 +3540,7 @@ namespace ImGui
|
|||||||
|
|
||||||
// Combos
|
// Combos
|
||||||
IMGUI_API bool BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags flags);
|
IMGUI_API bool BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags flags);
|
||||||
IMGUI_API bool BeginComboPreview(); // Submit preview contents for the *last* BeginCombo() call, to display contents that's more than just a text label.
|
IMGUI_API bool BeginComboPreview(); // Submit preview contents a combo. Call this after EndCombo() to display contents that's more than just a text label.
|
||||||
IMGUI_API void EndComboPreview();
|
IMGUI_API void EndComboPreview();
|
||||||
|
|
||||||
// Keyboard/Gamepad Navigation
|
// Keyboard/Gamepad Navigation
|
||||||
|
|||||||
@ -2074,6 +2074,7 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
g.BeginComboDepth++;
|
g.BeginComboDepth++;
|
||||||
|
g.CurrentWindowStack.back().ParentLastComboPreviewRect = g.ComboPreviewData.PreviewRect;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2081,6 +2082,7 @@ void ImGui::EndCombo()
|
|||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
g.BeginComboDepth--;
|
g.BeginComboDepth--;
|
||||||
|
g.ComboPreviewData.PreviewRect = g.CurrentWindowStack.back().ParentLastComboPreviewRect;
|
||||||
char name[16];
|
char name[16];
|
||||||
ImFormatString(name, IM_COUNTOF(name), "##Combo_%02d", g.BeginComboDepth); // FIXME: Move those to helpers?
|
ImFormatString(name, IM_COUNTOF(name), "##Combo_%02d", g.BeginComboDepth); // FIXME: Move those to helpers?
|
||||||
if (strcmp(g.CurrentWindow->Name, name) != 0)
|
if (strcmp(g.CurrentWindow->Name, name) != 0)
|
||||||
@ -2088,10 +2090,10 @@ void ImGui::EndCombo()
|
|||||||
EndPopup();
|
EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit preview contents for the *last* BeginCombo() call, to display contents that's more than just a text label.
|
// Submit preview contents for BeginCombo()/EndCombo(), to display contents that's more than just a text label.
|
||||||
// - [BETA] See GitHub issues: #1658, #4168.
|
// - [BETA] See GitHub issues: #1658, #4168.
|
||||||
|
// - Make sure you call this after EndCombo().
|
||||||
// - The preview is designed to only host non-interactive elements.
|
// - The preview is designed to only host non-interactive elements.
|
||||||
// - If you use nested combos, make sure you call this right after BeginCombo() and not after EndCombo(), in order to target the correct one.
|
|
||||||
// - Not compatible with ImGuiComboFlags_WidthFitPreview.
|
// - Not compatible with ImGuiComboFlags_WidthFitPreview.
|
||||||
// - 2026-09-08 (1.93.0): removed ImGuiComboFlags_CustomPreview. You can use BeginComboPreview()/EndComboPreview() without an extra flag.
|
// - 2026-09-08 (1.93.0): removed ImGuiComboFlags_CustomPreview. You can use BeginComboPreview()/EndComboPreview() without an extra flag.
|
||||||
bool ImGui::BeginComboPreview()
|
bool ImGui::BeginComboPreview()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user