From 79434ba17df404e9046fba8feadd7bbb7c14f6b9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 22 Oct 2016 20:39:34 +0200 Subject: 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 --- src/imports/controls/universal/Dialog.qml | 2 +- src/imports/controls/universal/DialogButtonBox.qml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 { -- cgit v1.2.3