From 2e8093175fd4edc502c7afdfbe415d2c803e71af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 8 Apr 2021 10:14:49 +0800 Subject: [PATCH] fill height according except fit mode --- doric-Qt/doric/resources/hlayout.qml | 7 ++++++- doric-Qt/doric/resources/vlayout.qml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doric-Qt/doric/resources/hlayout.qml b/doric-Qt/doric/resources/hlayout.qml index ac147193..f0648539 100644 --- a/doric-Qt/doric/resources/hlayout.qml +++ b/doric-Qt/doric/resources/hlayout.qml @@ -100,12 +100,17 @@ Rectangle { if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_X) { head.Layout.fillWidth = true } + + if (parent.widthSpec == 1) { + tail.Layout.fillWidth = false + } else { + tail.Layout.fillWidth = true + } } Item { id: tail objectName: "tail" - Layout.fillWidth: true } } } diff --git a/doric-Qt/doric/resources/vlayout.qml b/doric-Qt/doric/resources/vlayout.qml index ca18a124..3d4509b1 100644 --- a/doric-Qt/doric/resources/vlayout.qml +++ b/doric-Qt/doric/resources/vlayout.qml @@ -101,12 +101,17 @@ Rectangle { if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_Y) { head.Layout.fillHeight = true } + + if (parent.heightSpec == 1) { + tail.Layout.fillHeight = false + } else { + tail.Layout.fillHeight = true + } } Item { id: tail objectName: "tail" - Layout.fillHeight: true } } }