aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-04 19:22:39 +0200
committerDanilo M. <danix@danix.xyz>2026-08-04 19:22:39 +0200
commit8ac6037a3858e83f8391b87dc4acee4fd4363147 (patch)
tree4c2b892f448ddcfbb5273996df04ff664d97d7d2 /src
parent69e777cc72bd846c250d68656a8d558c9401fcd5 (diff)
downloadqtmaildir-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>
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp9
1 files changed, 9 insertions, 0 deletions
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) {