From 5b89a7ecb8283f8000b2b297ce6bbcae5a4948f0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 26 Sep 2016 12:12:41 +0200 Subject: [PATCH] fix(dialog): use dynamic height for dialog description --- tests/ui/components/dialog/DialogDescription.qml | 4 +++- tests/ui/style/components/DialogStyle.qml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/ui/components/dialog/DialogDescription.qml b/tests/ui/components/dialog/DialogDescription.qml index fa63c1950..c946b613d 100644 --- a/tests/ui/components/dialog/DialogDescription.qml +++ b/tests/ui/components/dialog/DialogDescription.qml @@ -9,7 +9,9 @@ import 'qrc:/ui/style/components' Item { property alias text: description.text - height: text ? DialogStyle.description.height : DialogStyle.description.minHeight + height: (!text && DialogStyle.description.verticalMargin) || undefined + implicitHeight: (text && (description.implicitHeight + DialogStyle.description.verticalMargin)) || + 0 Text { id: description diff --git a/tests/ui/style/components/DialogStyle.qml b/tests/ui/style/components/DialogStyle.qml index d510be8e6..36e3d8ba1 100644 --- a/tests/ui/style/components/DialogStyle.qml +++ b/tests/ui/style/components/DialogStyle.qml @@ -18,7 +18,6 @@ QtObject { property QtObject description: QtObject { property int fontSize: 12 - property int height: 90 // Height with text. - property int minHeight: 25 // Height without text. + property int verticalMargin: 25 } }