diff --git a/src/ui/windows/market_tab.cpp b/src/ui/windows/market_tab.cpp index 7a89a3c..c46cfaa 100644 --- a/src/ui/windows/market_tab.cpp +++ b/src/ui/windows/market_tab.cpp @@ -428,6 +428,7 @@ static void RenderPortfolioEditor(App* app) ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0, 0, 0, 0)); ImGui::BeginChild("##pfCard", ImVec2(cardW, cardH), ImGuiChildFlags_None, ImGuiWindowFlags_NoScrollbar); ImGui::PopStyleVar(); // pop WindowPadding — the 28x20 applies to ##pfCard only, not nested children + ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.5f, 0.5f)); // centered button labels material::DrawDialogTitleBar(TR("portfolio_manage_title"), nullptr); // no X — Close is in the footer if (ImGui::IsKeyPressed(ImGuiKey_Escape)) s_portfolio_editor_open = false; @@ -466,6 +467,7 @@ static void RenderPortfolioEditor(App* app) if (ImGui::Selectable("##pfgrp", selRow, ImGuiSelectableFlags_SpanAvailWidth, ImVec2(0, rowH))) { if (i != s_pf_sel) clickedSel = i; } + ImVec2 rowNext = ImGui::GetCursorScreenPos(); // next-row cursor (the delete button moves it) ImVec2 rmx(rmn.x + ImGui::GetItemRectSize().x, rmn.y + rowH); bool rowHov = ImGui::IsItemHovered(); ImU32 accent = en.color ? (ImU32)en.color : WithAlpha(OnSurface(), 60); @@ -498,6 +500,7 @@ static void RenderPortfolioEditor(App* app) ImVec2 isz = iconFont->CalcTextSizeA(iconFsz, FLT_MAX, 0, ICON_MD_DELETE_OUTLINE); mdl->AddText(iconFont, iconFsz, ImVec2(dmn.x + (ds - isz.x) * 0.5f, dmn.y + (ds - isz.y) * 0.5f), dhov ? Error() : OnSurfaceMedium(), ICON_MD_DELETE_OUTLINE); + ImGui::SetCursorScreenPos(rowNext); // restore flow so the next row isn't offset } ImGui::PopID(); } @@ -924,7 +927,7 @@ static void RenderPortfolioEditor(App* app) ImGui::EndChild(); // ##pfCard ImGui::PopStyleColor(); - ImGui::PopStyleVar(); // ChildRounding (WindowPadding was popped right after BeginChild) + ImGui::PopStyleVar(2); // ChildRounding + ButtonTextAlign (WindowPadding was popped after BeginChild) // Outside-click dismiss (guarded against the appearing frame and open popups). if (!popupOpen && !ImGui::IsWindowAppearing() && ImGui::IsMouseClicked(ImGuiMouseButton_Left)