aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-22 20:39:34 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-24 13:59:58 +0000
commit79434ba17df404e9046fba8feadd7bbb7c14f6b9 (patch)
tree7ae0cb5780abfbf68797f1bc3f22c7e0aa9294c6
parent762c2006bdbfec747e3ae538ba3ea8fa6ff91a8b (diff)
Universal: fix the size of a footer-less dialog
The Gallery example's About dialog is broken in the Universal style. The dialog doesn't have any bottom padding. Dialog cannot have bottom padding hard-coded to 0. It was assuming that there would be a DialogButtonBox that provides top padding. Set a suitable padding in the dialog instead, so that the dialog content gets padded without a footer. Due to this, we must tweak the top and bottom paddings of DialogButtonBox so that the total spacing between the dialog content and the buttons becomes 24 as it is in the specs. Change-Id: I77e2c3f66c5166391f9be595121f23bc95debde8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/imports/controls/universal/Dialog.qml2
-rw-r--r--src/imports/controls/universal/DialogButtonBox.qml2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/imports/controls/universal/Dialog.qml b/src/imports/controls/universal/Dialog.qml
index 194a2f4f..0f00b760 100644
--- a/src/imports/controls/universal/Dialog.qml
+++ b/src/imports/controls/universal/Dialog.qml
@@ -55,7 +55,7 @@ T.Dialog {
padding: 24
topPadding: 18
- bottomPadding: 0
+ bottomPadding: 18
background: Rectangle {
color: control.Universal.chromeMediumLowColor
diff --git a/src/imports/controls/universal/DialogButtonBox.qml b/src/imports/controls/universal/DialogButtonBox.qml
index 4c2481c9..043496d9 100644
--- a/src/imports/controls/universal/DialogButtonBox.qml
+++ b/src/imports/controls/universal/DialogButtonBox.qml
@@ -48,6 +48,8 @@ T.DialogButtonBox {
spacing: 4
padding: 24
+ topPadding: position === T.DialogButtonBox.Footer ? 6 : 24
+ bottomPadding: position === T.DialogButtonBox.Header ? 6 : 24
alignment: count === 1 ? Qt.AlignRight : undefined
delegate: Button {