From ef73453874886b0b6a8820bb757652891e9740e3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 15 Feb 2019 14:36:58 +0100 Subject: [PATCH] Fix height in the about dialog to show the logo correctly --- resources/qml/Dialogs/AboutDialog.qml | 54 ++++++++++++++------------ resources/themes/cura-light/theme.json | 2 +- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index 604cbc16ba..584903dd60 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -21,41 +21,45 @@ UM.Dialog Rectangle { + id: header width: parent.width + 2 * margin // margin from Dialog.qml - height: version.y + version.height + margin + height: childrenRect.height + topPadding anchors.top: parent.top - anchors.topMargin: - margin + anchors.topMargin: -margin anchors.horizontalCenter: parent.horizontalCenter + property real topPadding: UM.Theme.getSize("wide_margin").height + color: UM.Theme.getColor("main_window_header_background") - } - Image - { - id: logo - width: (base.minimumWidth * 0.85) | 0 - source: UM.Theme.getImage("logo") - sourceSize.width: width - sourceSize.height: height + Image + { + id: logo + width: (base.minimumWidth * 0.85) | 0 + height: (width * (UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)) | 0 + source: UM.Theme.getImage("logo") + sourceSize.width: width + sourceSize.height: height - anchors.top: parent.top - anchors.topMargin: ((base.minimumWidth - width) / 2) | 0 - anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: parent.topPadding + anchors.horizontalCenter: parent.horizontalCenter - UM.I18nCatalog{id: catalog; name: "cura"} - } + UM.I18nCatalog{id: catalog; name: "cura"} + } - Label - { - id: version + Label + { + id: version - text: catalog.i18nc("@label","version: %1").arg(UM.Application.version) - font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("button_text") - anchors.right : logo.right - anchors.top: logo.bottom - anchors.topMargin: (UM.Theme.getSize("default_margin").height / 2) | 0 + text: catalog.i18nc("@label","version: %1").arg(UM.Application.version) + font: UM.Theme.getFont("large_bold") + color: UM.Theme.getColor("button_text") + anchors.right : logo.right + anchors.top: logo.bottom + anchors.topMargin: (UM.Theme.getSize("default_margin").height / 2) | 0 + } } Label @@ -67,7 +71,7 @@ UM.Dialog text: catalog.i18nc("@label","End-to-end solution for fused filament 3D printing.") font: UM.Theme.getFont("system") wrapMode: Text.WordWrap - anchors.top: version.bottom + anchors.top: header.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 573fe8bcfa..92308537dd 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -473,7 +473,7 @@ "default_lining": [0.08, 0.08], "default_arrow": [0.8, 0.8], - "logo": [8, 2.4], + "logo": [8, 1.75], "wide_margin": [2.0, 2.0], "thick_margin": [1.71, 1.43],