Fix layout of dialog

CURA-9146
This commit is contained in:
Jaime van Kessel 2022-04-19 11:17:38 +02:00
parent 3ed182cd74
commit 05263b9a58
2 changed files with 8 additions and 19 deletions

View File

@ -5,7 +5,7 @@ import QtQuick 2.10
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
@ -47,12 +47,10 @@ UM.Dialog
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
// Compatible packages // Compatible packages
Label UM.Label
{ {
font: UM.Theme.getFont("default")
text: catalog.i18nc("@label", "The following packages will be added:") text: catalog.i18nc("@label", "The following packages will be added:")
visible: subscribedPackagesModel.hasCompatiblePackages visible: subscribedPackagesModel.hasCompatiblePackages
color: UM.Theme.getColor("text")
height: contentHeight + UM.Theme.getSize("default_margin").height height: contentHeight + UM.Theme.getSize("default_margin").height
} }
Repeater Repeater
@ -77,14 +75,13 @@ UM.Dialog
mipmap: true mipmap: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
Label UM.Label
{ {
text: model.display_name text: model.display_name
font: UM.Theme.getFont("medium_bold") font: UM.Theme.getFont("medium_bold")
anchors.left: packageIcon.right anchors.left: packageIcon.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: packageIcon.verticalCenter anchors.verticalCenter: packageIcon.verticalCenter
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
} }
} }
@ -92,12 +89,10 @@ UM.Dialog
} }
// Incompatible packages // Incompatible packages
Label UM.Label
{ {
font: UM.Theme.getFont("default")
text: catalog.i18nc("@label", "The following packages can not be installed because of an incompatible Cura version:") text: catalog.i18nc("@label", "The following packages can not be installed because of an incompatible Cura version:")
visible: subscribedPackagesModel.hasIncompatiblePackages visible: subscribedPackagesModel.hasIncompatiblePackages
color: UM.Theme.getColor("text")
height: contentHeight + UM.Theme.getSize("default_margin").height height: contentHeight + UM.Theme.getSize("default_margin").height
} }
Repeater Repeater
@ -122,14 +117,13 @@ UM.Dialog
mipmap: true mipmap: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
Label UM.Label
{ {
text: model.display_name text: model.display_name
font: UM.Theme.getFont("medium_bold") font: UM.Theme.getFont("medium_bold")
anchors.left: packageIcon.right anchors.left: packageIcon.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: packageIcon.verticalCenter anchors.verticalCenter: packageIcon.verticalCenter
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
} }
} }
@ -147,8 +141,6 @@ UM.Dialog
anchors.margins: UM.Theme.getSize("default_margin").height anchors.margins: UM.Theme.getSize("default_margin").height
text: actionButtonText text: actionButtonText
onClicked: accept() onClicked: accept()
leftPadding: UM.Theme.getSize("dialog_primary_button_padding").width
rightPadding: UM.Theme.getSize("dialog_primary_button_padding").width
} }
} }
} }

View File

@ -46,7 +46,7 @@ UM.Dialog
Image Image
{ {
id: icon id: icon
width: 30 * screenScaleFactor width: UM.Theme.getSize("card_icon").width
height: width height: width
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
@ -81,11 +81,8 @@ UM.Dialog
[ [
Cura.PrimaryButton Cura.PrimaryButton
{ {
leftPadding: UM.Theme.getSize("dialog_primary_button_padding").width
rightPadding: UM.Theme.getSize("dialog_primary_button_padding").width
text: licenseModel.acceptButtonText text: licenseModel.acceptButtonText
onClicked: { handler.onLicenseAccepted() } onClicked: handler.onLicenseAccepted()
} }
] ]
@ -95,7 +92,7 @@ UM.Dialog
{ {
id: declineButton id: declineButton
text: licenseModel.declineButtonText text: licenseModel.declineButtonText
onClicked: { handler.onLicenseDeclined() } onClicked: handler.onLicenseDeclined()
} }
] ]
} }