fix(ui): inset the consolidate address-list text from its border

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 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 16:33:16 -05:00
co-authored by Claude Opus 4.8
parent 3b828e8a49
commit 1a01de9791
+15 -4
View File
@@ -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<float>(listed), static_cast<float>(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<float>(p.batchesDone) / static_cast<float>(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<float>(addrs.size()), static_cast<float>(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.