Skip to content

Commit 612b787

Browse files
committed
Menus: fixed top-level menu from not consistently using style.PopupRounding. (#4788)
+ Stack tool default size.
1 parent 4bad852 commit 612b787

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docs/CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Other Changes:
7474
- Menus: fixed closing a menu by clicking on its menu-bar item when inside a popup. (#3496, #4797) [@xndcn]
7575
- Menus: fixed menu inside a popup/modal not inhibiting hovering of items in the popup/modal. (#3496, #4797)
7676
- Menus: fixed sub-menu items inside a popups from closing the popup.
77+
- Menus: fixed top-level menu from not consistently using style.PopupRounding. (#4788)
7778
- InputText, Nav: fixed repeated calls to SetKeyboardFocusHere() preventing to use InputText(). (#4682)
7879
- Inputtext, Nav: fixed using SetKeyboardFocusHere() on InputTextMultiline(). (#4761)
7980
- InputText: made double-click select word, triple-line select line. Word delimitation logic differs

imgui.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -12530,14 +12530,16 @@ void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* dat
1253012530
// Stack Tool: Display UI
1253112531
void ImGui::ShowStackToolWindow(bool* p_open)
1253212532
{
12533+
ImGuiContext& g = *GImGui;
12534+
if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize))
12535+
SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 8.0f), ImGuiCond_FirstUseEver);
1253312536
if (!Begin("Dear ImGui Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1)
1253412537
{
1253512538
End();
1253612539
return;
1253712540
}
1253812541

1253912542
// Display hovered/active status
12540-
ImGuiContext& g = *GImGui;
1254112543
const ImGuiID hovered_id = g.HoveredIdPreviousFrame;
1254212544
const ImGuiID active_id = g.ActiveId;
1254312545
#ifdef IMGUI_ENABLE_TEST_ENGINE

imgui_widgets.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -7050,7 +7050,9 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
70507050
if (menu_is_open)
70517051
{
70527052
SetNextWindowPos(popup_pos, ImGuiCond_Always); // Note: this is super misleading! The value will serve as reference for FindBestWindowPosForPopup(), not actual pos.
7053+
PushStyleVar(ImGuiStyleVar_ChildRounding, style.PopupRounding); // First level will use _PopupRounding, subsequent will use _ChildRounding
70537054
menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
7055+
PopStyleVar();
70547056
}
70557057
else
70567058
{

0 commit comments

Comments
 (0)