summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2025-11-24 07:00:37 -0700
committerGitHub <noreply@github.com>2025-11-24 14:00:37 +0000
commit2ee4e70b9a414ded4b9d4609e6b3cd16462f6939 (patch)
treeaab0fd69ce48bd67bb15ff6c8985bdcb5e05aaad
parentc68c8f128439fd02f955cc2a0482a6a172373a8e (diff)
Fix menu header width and scrollbar calculations. (#5975)
-rw-r--r--soh/soh/SohGui/Menu.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/soh/soh/SohGui/Menu.cpp b/soh/soh/SohGui/Menu.cpp
index 592c0c5e6..e3db0ae01 100644
--- a/soh/soh/SohGui/Menu.cpp
+++ b/soh/soh/SohGui/Menu.cpp
@@ -650,18 +650,15 @@ void Menu::DrawElement() {
ImVec2 pos = window->DC.CursorPos;
float centerX = pos.x + windowWidth / 2 - (style.ItemSpacing.x * (menuEntries.size() + 1));
std::vector<ImVec2> headerSizes;
- float headerWidth = style.ItemSpacing.x + 20;
+ float headerWidth = 0.0f;
bool headerSearch = !CVarGetInteger(CVAR_SETTING("Menu.SidebarSearch"), 0);
if (headerSearch) {
- headerWidth += 200.0f + style.ItemSpacing.x + style.FramePadding.x;
+ headerWidth += 200.0f;
}
for (auto& label : menuOrder) {
ImVec2 size = ImGui::CalcTextSize(label.c_str());
headerSizes.push_back(size);
- headerWidth += size.x + style.FramePadding.x * 2;
- if (label == headerIndex) {
- headerWidth += style.ItemSpacing.x;
- }
+ headerWidth += size.x + style.FramePadding.x * 2 + style.ItemSpacing.x;
}
// Full screen menu with widths below 1280, heights below 800.