fix(StatusDropdown, StatusDialog): height calculation improved
It improves workaround for QTBUG-87804 in StatusDropdown, to work nicely whenever content is set via contentItem or not. The same solution is added to StatusDialog. Closes: #11768
This commit is contained in:
parent
780a6b6c68
commit
f85986bfb0
|
@ -48,6 +48,15 @@ Item {
|
|||
when: false
|
||||
}
|
||||
|
||||
onImplicitContentHeightChanged: {
|
||||
if (!workAroundCheckBox.checked)
|
||||
return
|
||||
|
||||
workaroundBinding.value = popup.margins + 1
|
||||
workaroundBinding.when = true
|
||||
workaroundBinding.when = false
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Button {
|
||||
text: "Some button 1"
|
||||
|
@ -60,15 +69,6 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
onImplicitHeightChanged: {
|
||||
if (!workAroundCheckBox.checked)
|
||||
return
|
||||
|
||||
workaroundBinding.value = popup.margins + 1
|
||||
workaroundBinding.when = true
|
||||
workaroundBinding.when = false
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
ListView {
|
||||
|
|
|
@ -57,13 +57,9 @@ QC.Popup {
|
|||
restoreMode: Binding.RestoreBindingOrValue
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.contentItem
|
||||
|
||||
function onImplicitHeightChanged() {
|
||||
onImplicitContentHeightChanged: {
|
||||
workaroundBinding.value = root.margins + 1
|
||||
workaroundBinding.when = true
|
||||
workaroundBinding.when = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,12 @@ Dialog {
|
|||
restoreMode: Binding.RestoreBindingOrValue
|
||||
}
|
||||
|
||||
onImplicitContentHeightChanged: {
|
||||
workaroundBinding.value = root.margins + 1
|
||||
workaroundBinding.when = true
|
||||
workaroundBinding.when = false
|
||||
}
|
||||
|
||||
standardButtons: Dialog.Cancel | Dialog.Ok
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
|
|
|
@ -167,12 +167,6 @@ StatusDialog {
|
|||
|
||||
anchors.fill: parent
|
||||
|
||||
// Workaround for https://bugreports.qt.io/browse/QTBUG-87804
|
||||
onImplicitHeightChanged: {
|
||||
margins--
|
||||
margins++
|
||||
}
|
||||
|
||||
ClippingWrapper {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: assetAndAmountSelector.implicitHeight
|
||||
|
|
Loading…
Reference in New Issue