From 8ac6037a3858e83f8391b87dc4acee4fd4363147 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 4 Aug 2026 19:22:39 +0200 Subject: 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 --- src/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3