aboutsummaryrefslogtreecommitdiffstats
path: root/src/pendingchangesdialog.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-26 20:14:33 +0200
committerDanilo M. <danix@danix.xyz>2026-08-26 20:14:33 +0200
commit494e2f263831614f3ea4f023ba93ccc7d740e0c1 (patch)
tree64206f9847760146a623abd8339df7442bcc9a5a /src/pendingchangesdialog.cpp
parent59a196ea849c64c51311f56bf62130e74d90b784 (diff)
downloadqtmaildir-494e2f263831614f3ea4f023ba93ccc7d740e0c1.tar.gz
qtmaildir-494e2f263831614f3ea4f023ba93ccc7d740e0c1.zip
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P88Q3MCSCSQxKDy7pmXh9F
Diffstat (limited to 'src/pendingchangesdialog.cpp')
-rw-r--r--src/pendingchangesdialog.cpp12
1 files changed, 11 insertions, 1 deletions
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));
}