From 2ed5381f5a41a04aa8f7237b6e98f386ce3c5410 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 17 May 2024 22:14:15 +0200 Subject: [PATCH] impr: Make menu bar items collapse less quickly --- plugins/builtin/source/content/window_decoration.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/window_decoration.cpp b/plugins/builtin/source/content/window_decoration.cpp index 9833ff23f..da6a9b6e7 100644 --- a/plugins/builtin/source/content/window_decoration.cpp +++ b/plugins/builtin/source/content/window_decoration.cpp @@ -292,7 +292,9 @@ namespace hex::plugin::builtin { auto menuName = Lang(menuItem.unlocalizedName); const auto padding = ImGui::GetStyle().FramePadding.x; - auto width = ImGui::CalcTextSize(menuName).x + padding * 4; + bool lastItem = (fittingItems + 1) == menuItems.size(); + auto width = ImGui::CalcTextSize(menuName).x + padding * (lastItem ? -3.0F : 4.0F); + if ((cursorPos + width) > (s_searchBarPosition - ImGui::CalcTextSize(ICON_VS_ELLIPSIS).x - padding * 2)) break;