Fix size of ColorDialog

CURA-9997
This commit is contained in:
c.lamboo 2022-12-12 11:58:22 +01:00
parent 6ead64049b
commit 7e8eca3b03

View File

@ -28,8 +28,11 @@ UM.Dialog
// however with the current implementation of the dialog this is not possible, so instead we calculate // however with the current implementation of the dialog this is not possible, so instead we calculate
// the size of the dialog ourselves. // the size of the dialog ourselves.
// Ugly workaround for windows having overlapping elements due to incorrect dialog width // Ugly workaround for windows having overlapping elements due to incorrect dialog width
minimumWidth: content.width + (Qt.platform.os == "windows" ? 4 * margin : 2 * margin) minimumWidth: content.width + (Qt.platform.os === "windows" ? 4 * margin : 2 * margin)
minimumHeight: content.height + footer.height + (Qt.platform.os == "windows" ? 5 * margin : 3 * margin) minimumHeight: {
const footerHeight = Math.max(okButton.height, cancelButton.height);
return content.height + footerHeight + (Qt.platform.os === "windows" ? 5 * margin : 3 * margin);
}
property alias color: colorInput.text property alias color: colorInput.text
property var swatchColors: [ property var swatchColors: [
@ -136,10 +139,12 @@ UM.Dialog
rightButtons: rightButtons:
[ [
Cura.TertiaryButton { Cura.TertiaryButton {
id: cancelButton
text: catalog.i18nc("@action:button", "Cancel") text: catalog.i18nc("@action:button", "Cancel")
onClicked: base.close() onClicked: base.close()
}, },
Cura.PrimaryButton { Cura.PrimaryButton {
id: okButton
text: catalog.i18nc("@action:button", "OK") text: catalog.i18nc("@action:button", "OK")
onClicked: base.accept() onClicked: base.accept()
} }