Fix height in the about dialog to show the logo correctly

This commit is contained in:
Diego Prado Gesto 2019-02-15 14:36:58 +01:00
parent 21bc8d7990
commit ef73453874
2 changed files with 30 additions and 26 deletions

View File

@ -21,41 +21,45 @@ UM.Dialog
Rectangle Rectangle
{ {
id: header
width: parent.width + 2 * margin // margin from Dialog.qml width: parent.width + 2 * margin // margin from Dialog.qml
height: version.y + version.height + margin height: childrenRect.height + topPadding
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: - margin anchors.topMargin: -margin
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
property real topPadding: UM.Theme.getSize("wide_margin").height
color: UM.Theme.getColor("main_window_header_background") color: UM.Theme.getColor("main_window_header_background")
}
Image Image
{ {
id: logo id: logo
width: (base.minimumWidth * 0.85) | 0 width: (base.minimumWidth * 0.85) | 0
source: UM.Theme.getImage("logo") height: (width * (UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)) | 0
sourceSize.width: width source: UM.Theme.getImage("logo")
sourceSize.height: height sourceSize.width: width
sourceSize.height: height
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: ((base.minimumWidth - width) / 2) | 0 anchors.topMargin: parent.topPadding
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
} }
Label Label
{ {
id: version id: version
text: catalog.i18nc("@label","version: %1").arg(UM.Application.version) text: catalog.i18nc("@label","version: %1").arg(UM.Application.version)
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("button_text") color: UM.Theme.getColor("button_text")
anchors.right : logo.right anchors.right : logo.right
anchors.top: logo.bottom anchors.top: logo.bottom
anchors.topMargin: (UM.Theme.getSize("default_margin").height / 2) | 0 anchors.topMargin: (UM.Theme.getSize("default_margin").height / 2) | 0
}
} }
Label Label
@ -67,7 +71,7 @@ UM.Dialog
text: catalog.i18nc("@label","End-to-end solution for fused filament 3D printing.") text: catalog.i18nc("@label","End-to-end solution for fused filament 3D printing.")
font: UM.Theme.getFont("system") font: UM.Theme.getFont("system")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
anchors.top: version.bottom anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
} }

View File

@ -473,7 +473,7 @@
"default_lining": [0.08, 0.08], "default_lining": [0.08, 0.08],
"default_arrow": [0.8, 0.8], "default_arrow": [0.8, 0.8],
"logo": [8, 2.4], "logo": [8, 1.75],
"wide_margin": [2.0, 2.0], "wide_margin": [2.0, 2.0],
"thick_margin": [1.71, 1.43], "thick_margin": [1.71, 1.43],