fill height according except fit mode

This commit is contained in:
王劲鹏 2021-04-08 10:14:49 +08:00 committed by osborn
parent ad1b1a979b
commit 2e8093175f
2 changed files with 12 additions and 2 deletions

View File

@ -100,12 +100,17 @@ Rectangle {
if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_X) { if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_X) {
head.Layout.fillWidth = true head.Layout.fillWidth = true
} }
if (parent.widthSpec == 1) {
tail.Layout.fillWidth = false
} else {
tail.Layout.fillWidth = true
}
} }
Item { Item {
id: tail id: tail
objectName: "tail" objectName: "tail"
Layout.fillWidth: true
} }
} }
} }

View File

@ -101,12 +101,17 @@ Rectangle {
if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_Y) { if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_Y) {
head.Layout.fillHeight = true head.Layout.fillHeight = true
} }
if (parent.heightSpec == 1) {
tail.Layout.fillHeight = false
} else {
tail.Layout.fillHeight = true
}
} }
Item { Item {
id: tail id: tail
objectName: "tail" objectName: "tail"
Layout.fillHeight: true
} }
} }
} }