Fix margins in the WhatsNew pages

CURA-8154
This commit is contained in:
Kostas Karmas 2021-04-09 15:08:43 +02:00
parent 89697ea489
commit 92dafccf6d

View File

@ -31,23 +31,16 @@ Item
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Item
{
id: topSpacer
anchors.top: titleLabel.bottom
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").width
}
Rectangle Rectangle
{ {
anchors anchors
{ {
top: topSpacer.bottom top: titleLabel.bottom
topMargin: UM.Theme.getSize("default_margin").width
bottom: whatsNewDots.top bottom: whatsNewDots.top
bottomMargin: UM.Theme.getSize("narrow_margin").width
left: parent.left left: parent.left
right: parent.right right: parent.right
margins: UM.Theme.getSize("default_margin").width * 2
} }
color: UM.Theme.getColor("viewport_overlay") color: UM.Theme.getColor("viewport_overlay")
@ -59,7 +52,6 @@ Item
anchors anchors
{ {
top: parent.top top: parent.top
topMargin: UM.Theme.getSize("default_margin").width
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
height: parent.height height: parent.height
@ -69,12 +61,6 @@ Item
Repeater Repeater
{ {
anchors
{
top: parent.top
topMargin: UM.Theme.getSize("default_margin").width / 2
horizontalCenter: parent.horizontalCenter
}
model: manager.subpageCount model: manager.subpageCount
@ -82,6 +68,8 @@ Item
{ {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
color: UM.Theme.getColor("viewport_overlay") color: UM.Theme.getColor("viewport_overlay")
width: whatsNewViewport.width
height: whatsNewViewport.height
Image Image
{ {
@ -89,12 +77,15 @@ Item
anchors anchors
{ {
horizontalCenter: parent.horizontalCenter
top: parent.top top: parent.top
topMargin: UM.Theme.getSize("default_margin").width topMargin: UM.Theme.getSize("thick_margin").width
left: parent.left
leftMargin: UM.Theme.getSize("thick_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("thick_margin").width
} }
width: Math.round(parent.width - (UM.Theme.getSize("default_margin").width * 2)) width: sourceSize.width
height: Math.round((parent.height - UM.Theme.getSize("default_margin").height) * 0.75) sourceSize.width: Math.round(parent.width - (UM.Theme.getSize("thick_margin").height * 2))
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: manager.getSubpageImageSource(index) source: manager.getSubpageImageSource(index)
@ -108,9 +99,10 @@ Item
{ {
top: subpageImage.bottom top: subpageImage.bottom
bottom: parent.bottom bottom: parent.bottom
horizontalCenter: parent.horizontalCenter bottomMargin: UM.Theme.getSize("thick_margin").height
left: subpageImage.left
right: subpageImage.right
} }
width: Math.round(parent.width - (UM.Theme.getSize("default_margin").width * 2))
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
@ -139,7 +131,8 @@ Item
anchors anchors
{ {
bottom: bottomSpacer.top bottom: whatsNewNextButton.top
bottomMargin: UM.Theme.getSize("narrow_margin").height
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }