From 1a01de97910bda1dfe15bc27f3f61f71f13a47a3 Mon Sep 17 00:00:00 2001 From: DanS Date: Mon, 26 Oct 2026 16:33:16 -0500 Subject: [PATCH] fix(ui): inset the consolidate address-list text from its border MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The per-address list boxes (the run-progress list and the selection list) drew their text flush against the border. The Consolidate dialog is a floating overlay, which pops its content padding after the content child, so the ambient WindowPadding is 0 — a bordered child therefore got no inner padding and its rows touched the border. Push a small inner padding (10px, DPI-scaled) and AlwaysUseWindowPadding for both lists, reserving it in their heights, so the rows sit comfortably inset. Build + tests + hygiene green. Co-Authored-By: Claude Opus 4.8 --- src/ui/windows/shield_dialog.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/ui/windows/shield_dialog.cpp b/src/ui/windows/shield_dialog.cpp index 79172d3..7a0fdd7 100644 --- a/src/ui/windows/shield_dialog.cpp +++ b/src/ui/windows/shield_dialog.cpp @@ -553,9 +553,12 @@ void ShieldDialog::render(App* app) if (s_scan.phase == services::ScopePhase::Loaded && listed == 0) { wrappedCaption(material::Warning(), TR("merge_keep_each_none")); } else if (listed > 0) { + const float eachPad = 10.0f * dp; // inner padding (the floating overlay leaves ambient 0) const float listH = std::min(static_cast(listed), static_cast(maxRows)) * rowH + - ImGui::GetStyle().WindowPadding.y * 2.0f; - if (ImGui::BeginChild("##ConsolidateEach", ImVec2(-1, listH), ImGuiChildFlags_Borders)) { + eachPad * 2.0f; + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(eachPad, eachPad)); + if (ImGui::BeginChild("##ConsolidateEach", ImVec2(-1, listH), + ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding)) { for (const auto& g : s_groups) { if (g.notes < 2) continue; const bool worth = services::worthConsolidating(g, s_fee); @@ -579,6 +582,7 @@ void ShieldDialog::render(App* app) } } ImGui::EndChild(); + ImGui::PopStyleVar(); // ##ConsolidateEach inner padding } ImGui::Spacing(); } @@ -733,10 +737,16 @@ void ShieldDialog::render(App* app) ImGui::ProgressBar(static_cast(p.batchesDone) / static_cast(std::max(1, p.batchesEstimated)), ImVec2(-1, 0)); const auto& addrs = run.addresses(); + // Inner padding for the bordered list: this floating overlay pops its content padding, so the + // ambient WindowPadding is 0 and a bordered child's text would otherwise touch the border. Push a + // small padding (and reserve it in the height) so the rows sit inset. + const float listPad = 10.0f * dp; const float runListH = std::min(static_cast(addrs.size()), static_cast(maxRows)) * rowH + - ImGui::GetStyle().WindowPadding.y * 2.0f; + listPad * 2.0f; bool leftovers = false; - if (ImGui::BeginChild("##ConsolidateRuns", ImVec2(-1, runListH), ImGuiChildFlags_Borders)) { + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(listPad, listPad)); + if (ImGui::BeginChild("##ConsolidateRuns", ImVec2(-1, runListH), + ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding)) { for (const auto& a : addrs) { const std::string label = app->getAddressLabel(a.group.address); const std::string name = label.empty() ? shortAddr(a.group.address) : label; @@ -772,6 +782,7 @@ void ShieldDialog::render(App* app) } } ImGui::EndChild(); + ImGui::PopStyleVar(); // ##ConsolidateRuns inner padding { // The "run again" hint appears partway through a run (once an address has leftover notes). While // the run is live, reserve its measured height up front so it appearing doesn't shift the modal.