From 494e2f263831614f3ea4f023ba93ccc7d740e0c1 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 26 Aug 2026 20:14:33 +0200 Subject: fix: size the pending-changes dialog to its content 380px of dialog for three rows left most of itself empty. The height is asked of the layout now, capped so a long list scrolls rather than growing past the screen and floored so a single row does not collapse it. A background role on the scroll viewport was tried in the same pass and reverted: the dialog renders semi-transparent under the developer's compositor, and painting a Base-coloured layer under the list made that worse rather than better. The transparency is the desktop's own doing, which is the trap this project has already recorded for window geometry. Not covered by a test. The offscreen platform returns an identical frame for a correct size and a broken one, so an assertion there would pass against both; CLAUDE.md records that measurement. Confirmed by hand instead. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01P88Q3MCSCSQxKDy7pmXh9F --- src/pendingchangesdialog.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pendingchangesdialog.cpp b/src/pendingchangesdialog.cpp index 71e3bb0..bd9fbcb 100644 --- a/src/pendingchangesdialog.cpp +++ b/src/pendingchangesdialog.cpp @@ -117,5 +117,15 @@ PendingChangesDialog::PendingChangesDialog( connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); layout->addWidget(buttons); - resize(600, 380); + // Sized to the content rather than to a fixed guess: a handful of pending + // changes is the common case and a 380px box left most of itself empty. + // The cap is what keeps a long list scrollable instead of taller than the + // screen; the floor keeps the dialog from collapsing around one row. + // + // sizeHint() on the content is the whole grid's, so this asks the layout + // what it needs rather than multiplying a row height by a count. + const int wanted = content->sizeHint().height() + + intro->sizeHint().height() + + buttons->sizeHint().height() + 60; + resize(620, qBound(180, wanted, 560)); } -- cgit v1.2.3