From 10f0da6cfb56396a16ec741380556320fba86552 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 27 Aug 2014 09:12:24 +0200 Subject: Do not shrink application window height to 0 The binding was always evaluated to 0 if __noImplicitHeightGiven was true. The solution is to move the condition to the Binding element, which will then cause it to not be triggered when it was previously be evaluated to 0. Task-number: QTBUG-38469 Change-Id: I6ff80e44069978ee9685ea2fbe52afc52425cbdc Reviewed-by: Richard Moe Gustavsen Reviewed-by: J-P Nurmi --- src/controls/ApplicationWindow.qml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/controls/ApplicationWindow.qml') diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index 185f33ef..bc2bf329 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -171,7 +171,7 @@ Window { Binding { target: root property: "__width" - when: root.minimumWidth <= root.maximumWidth + when: (root.minimumWidth <= root.maximumWidth) && !contentArea.__noImplicitWidthGiven value: Math.max(Math.min(root.maximumWidth, contentArea.implicitWidth), root.minimumWidth) } /*! \internal */ @@ -179,11 +179,16 @@ Window { Binding { target: root property: "__height" - when: root.minimumHeight <= root.maximumHeight + when: (root.minimumHeight <= root.maximumHeight) && !contentArea.__noImplicitHeightGiven value: Math.max(Math.min(root.maximumHeight, contentArea.implicitHeight + __topBottomMargins), root.minimumHeight) } - width: contentArea.__noImplicitWidthGiven ? 0 : __width - height: contentArea.__noImplicitHeightGiven ? 0 : __height + /* As soon as an application developer writes + width: 200 + this binding will be broken. This is the reason for this indirection + via __width (and __height) + */ + width: __width + height: __height minimumWidth: contentArea.__noMinimumWidthGiven ? 0 : contentArea.minimumWidth minimumHeight: contentArea.__noMinimumHeightGiven ? 0 : (contentArea.minimumHeight + __topBottomMargins) -- cgit v1.2.1