Skip to content

Commit 3f7ca42

Browse files
committed
feat(dialogs): make dialog button intent explicit per dialog
Each dialog now declares its own standard buttons rather than relying on the base dialog's OK-only default, so the intent is clear and correct at every call site. Settings dialogs gain a Cancel button to expose a visible discard path; previously the rollback was only reachable via Escape, with no button to indicate that changes could be discarded. Informational dialogs use Close, whose dismiss semantics fit a dialog that has nothing to accept. With every dialog now specifying its buttons explicitly, the base default is redundant and removed.
1 parent 0952edc commit 3f7ca42

7 files changed

Lines changed: 7 additions & 1 deletion

File tree

qt/qml/io/github/mpvqc/mpvQC/Components/MpvqcDialog.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Dialog {
2121
dim: false
2222
z: 2
2323
closePolicy: Popup.CloseOnEscape
24-
standardButtons: Dialog.Ok
2524

2625
Binding {
2726
when: root.popupType === Popup.Window

qt/qml/io/github/mpvqc/mpvQC/Dialogs/MpvqcAboutDialog.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ MpvqcDialog {
3535
readonly property int rowSpacing: 10
3636

3737
contentHeight: Math.min(720, MpvqcWindowUtility.appHeight * 0.65)
38+
standardButtons: Dialog.Close
3839

3940
contentItem: ScrollView {
4041
readonly property bool isVerticalScollBarShown: contentHeight > root.contentHeight

qt/qml/io/github/mpvqc/mpvQC/Dialogs/MpvqcAppearanceDialog.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ MpvqcDialog {
3939
contentHeight: MpvqcConstants.smallDialogContentHeight
4040

4141
title: qsTranslate("AppearanceDialog", "Appearance")
42+
standardButtons: Dialog.Ok | Dialog.Cancel
4243

4344
component SelectionDelegate: ItemDelegate {
4445
id: delegateRoot

qt/qml/io/github/mpvqc/mpvQC/Dialogs/MpvqcBackupDialog.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ MpvqcDialog {
2424
contentHeight: MpvqcConstants.smallDialogContentHeight
2525

2626
title: qsTranslate("BackupDialog", "Backup Settings")
27+
standardButtons: Dialog.Ok | Dialog.Cancel
2728

2829
contentItem: ColumnLayout {
2930

qt/qml/io/github/mpvqc/mpvQC/Dialogs/MpvqcExportSettingsDialog.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

55
import QtQuick
6+
import QtQuick.Controls.Material
67
import QtQuick.Layouts
78

89
import io.github.mpvqc.mpvQC.Components
@@ -18,6 +19,7 @@ MpvqcDialog {
1819
contentHeight: MpvqcConstants.smallDialogContentHeight
1920

2021
title: qsTranslate("ExportSettingsDialog", "Export Settings")
22+
standardButtons: Dialog.Ok | Dialog.Cancel
2123

2224
contentItem: ColumnLayout {
2325
spacing: 10

qt/qml/io/github/mpvqc/mpvQC/Dialogs/MpvqcImportSettingsDialog.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ MpvqcDialog {
1919
contentHeight: MpvqcConstants.smallDialogContentHeight
2020

2121
title: qsTranslate("ImportSettingsDialog", "Import Settings")
22+
standardButtons: Dialog.Ok | Dialog.Cancel
2223

2324
contentItem: ColumnLayout {
2425
spacing: 10

qt/qml/io/github/mpvqc/mpvQC/Dialogs/MpvqcShortcutDialog.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ MpvqcDialog {
2121

2222
contentWidth: MpvqcConstants.mediumDialogContentWidth
2323
contentHeight: Math.min(720, MpvqcWindowUtility.appHeight * 0.65)
24+
standardButtons: Dialog.Close
2425

2526
contentItem: ColumnLayout {
2627
spacing: 0

0 commit comments

Comments
 (0)