diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-04 19:22:39 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-04 19:22:39 +0200 |
| commit | 8ac6037a3858e83f8391b87dc4acee4fd4363147 (patch) | |
| tree | 4c2b892f448ddcfbb5273996df04ff664d97d7d2 | |
| parent | 69e777cc72bd846c250d68656a8d558c9401fcd5 (diff) | |
| download | qtmaildir-8ac6037a3858e83f8391b87dc4acee4fd4363147.tar.gz qtmaildir-8ac6037a3858e83f8391b87dc4acee4fd4363147.zip | |
fix(ui): name the default button on the quit prompt
Item 31. The user could not tell which button Enter would press on the
unsynced-changes dialog.
The code was already correct: setDefaultButton() is called, and Qt agrees,
isDefault() and hasFocus() are both true on "Sync and quit". The active
style, qt6ct-style, simply draws no visible default-button decoration. The
GIMP dialog offered for comparison is GTK drawing its own focus ring, a
different toolkit.
Naming the default in the text rather than restyling the button:
overriding the appearance means fighting the user's theme, which is worse
than one word. The safe option was already the default, so no behaviour
changed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| -rw-r--r-- | docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md | 18 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 9 |
2 files changed, 26 insertions, 1 deletions
diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md index f7cf0e3..1edcf59 100644 --- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md +++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md @@ -75,7 +75,7 @@ taking that too literally. | 28 | Re-adding `unread` counts 2 unsynced changes, not 0 | correctness | S | open | | 29 | Sync button stays enabled during a background sync | feedback | XS | **done** | | 30 | The blank right pane is wasted space | presentation | M | open | -| 31 | The quit prompt has no highlighted default button | discoverability | XS | open, needs repro | +| 31 | The quit prompt has no highlighted default button | discoverability | XS | **done** | | 32 | Esc does not blank the right pane | workflow | XS | **done** | | 33 | Status bar messages never expire | feedback | S | open | | 34 | No overview of the Maildir itself | information | M | open | @@ -1489,6 +1489,22 @@ theme issue the item becomes a documentation note rather than a change. **Constraint:** whatever default is chosen must be the safe one. On a prompt about losing unsynced work, Enter must not fall on "Quit anyway". +### Outcome (done): the code was right, the theme draws nothing + +Reproduced from a screenshot: it is the three-button `ask` prompt. Probed rather +than guessed, and Qt agrees the default is set. On that dialog `isDefault()` and +`hasFocus()` are both true on "Sync and quit", and `defaultButton()` returns it. + +**The active style is `qt6ct-style`, which draws no visible default-button +decoration.** The GIMP dialog the user compared against is GTK drawing its own +focus ring, a different toolkit, so the two are not comparable and this was never +a qtmaildir bug. + +Fixed by naming the default in the button text rather than restyling it. +Overriding a button's appearance means fighting the user's chosen theme, which +is a worse outcome than one word. The safe option was already the default, per +the constraint above, so no behaviour changed. + ## 32. Esc does not blank the right pane **Observed (user, 2026-08-04):** "Esc in the main window should blank the right diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e546af5..b62d8d7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -189,6 +189,15 @@ void MainWindow::closeEvent(QCloseEvent *event) box.addButton(tr("Quit anyway"), QMessageBox::DestructiveRole); box.addButton(QMessageBox::Cancel); box.setDefaultButton(sync); + + // The default is set correctly and Qt agrees (isDefault() and + // hasFocus() are both true on it), but qt6ct-style draws no + // visible default-button decoration, so Enter's target is + // invisible on this desktop. Naming it in the text costs nothing + // and does not fight the theme. + // ponytail: text, not a styled button. Restyling the button means + // overriding the user's theme, which is worse than a sentence. + sync->setText(tr("Sync and quit (default)")); box.exec(); if (box.clickedButton() == sync) { |
