fix(toolbar): keep branch picker size stable
All checks were successful
Build Windows EXE / build-windows (push) Successful in 5m25s

This commit is contained in:
2026-06-18 19:47:53 -05:00
parent ceac4ae28e
commit f71bb015ba

View File

@@ -1652,8 +1652,10 @@ void draw_app() {
} }
if (toolbar_selector("branch", "branch", repo().branch, 150.0f)) ImGui::OpenPopup("branch_selector"); if (toolbar_selector("branch", "branch", repo().branch, 150.0f)) ImGui::OpenPopup("branch_selector");
const float selectors_right = ImGui::GetItemRectMax().x - ImGui::GetWindowPos().x; const float selectors_right = ImGui::GetItemRectMax().x - ImGui::GetWindowPos().x;
ImGui::SetNextWindowSize({ui(320.0f), ui(370.0f)}, ImGuiCond_Appearing); const ImVec2 branch_popup_size{ui(320.0f), ui(370.0f)};
if (ImGui::BeginPopup("branch_selector")) { ImGui::SetNextWindowSize(branch_popup_size, ImGuiCond_Always);
ImGui::SetNextWindowSizeConstraints(branch_popup_size, branch_popup_size);
if (ImGui::BeginPopup("branch_selector", ImGuiWindowFlags_NoResize)) {
if (ImGui::IsWindowAppearing()) ImGui::SetKeyboardFocusHere(); if (ImGui::IsWindowAppearing()) ImGui::SetKeyboardFocusHere();
ImGui::SetNextItemWidth(-1); ImGui::SetNextItemWidth(-1);
ImGui::InputTextWithHint("##branch_search", ICON_FA_MAGNIFYING_GLASS " Search branches...", ImGui::InputTextWithHint("##branch_search", ICON_FA_MAGNIFYING_GLASS " Search branches...",