From 06a4587ab7f3bdd402c39bef473802c25638dc17 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 2 Mar 2024 01:47:11 +0100 Subject: [PATCH] ImGui: pad last button in server browser correctly Previously, it would clip with the resize handle due to commit eda8048a982f88611710bcded1d2245e9d42d95e --- src/gameui/IBrowser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gameui/IBrowser.cpp b/src/gameui/IBrowser.cpp index d634a1a0..7078f5b2 100644 --- a/src/gameui/IBrowser.cpp +++ b/src/gameui/IBrowser.cpp @@ -343,7 +343,11 @@ void CBrowser::DrawBrowserPanel(void) } ImGui::SameLine(); - if (ImGui::Button("Private servers", ImVec2(itemWidth, ImGui::GetFrameHeight()))) + + // NOTE: -9 to prevent the last button from clipping/colliding with the + // window drag handle! -9 makes the distance between the handle and the + // last button equal as that of the developer console. + if (ImGui::Button("Private servers", ImVec2(itemWidth - 9, ImGui::GetFrameHeight()))) { ImGui::OpenPopup("Private Server"); }