update fill condition

This commit is contained in:
王劲鹏 2021-04-08 10:23:23 +08:00 committed by osborn
parent 2e8093175f
commit 5c5d6165c2
2 changed files with 10 additions and 8 deletions

View File

@ -97,13 +97,14 @@ Rectangle {
}
}
if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_X) {
head.Layout.fillWidth = true
}
if (parent.widthSpec == 1) {
tail.Layout.fillWidth = false
} else {
if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_X) {
head.Layout.fillWidth = true
} else {
head.Layout.fillWidth = false
}
tail.Layout.fillWidth = true
}
}

View File

@ -98,13 +98,14 @@ Rectangle {
}
}
if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_Y) {
head.Layout.fillHeight = true
}
if (parent.heightSpec == 1) {
tail.Layout.fillHeight = false
} else {
if (gravity === Gravity.enumerate().CENTER || gravity === Gravity.enumerate().CENTER_Y) {
head.Layout.fillHeight = true
} else {
head.Layout.fillHeight = false
}
tail.Layout.fillHeight = true
}
}