Simplify QML

This commit is contained in:
Jaime van Kessel 2018-12-06 19:38:12 +01:00
parent d4a255c9e5
commit eddf4e7f3d

View File

@ -21,44 +21,39 @@ ScrollView
Column Column
{ {
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
visible: toolbox.pluginsInstalledModel.items.length > 0
height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height
anchors anchors
{ {
right: parent.right right: parent.right
left: parent.left left: parent.left
leftMargin: UM.Theme.getSize("wide_margin").width margins: UM.Theme.getSize("default_margin").width
topMargin: UM.Theme.getSize("wide_margin").height
bottomMargin: UM.Theme.getSize("wide_margin").height
top: parent.top top: parent.top
} }
height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height
Label Label
{ {
visible: toolbox.pluginsInstalledModel.items.length > 0 width: page.width
width: parent.width
text: catalog.i18nc("@title:tab", "Plugins") text: catalog.i18nc("@title:tab", "Plugins")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
} }
Rectangle Rectangle
{ {
visible: toolbox.pluginsInstalledModel.items.length > 0
color: "transparent" color: "transparent"
width: parent.width width: parent.width
height: childrenRect.height + 1 * UM.Theme.getSize("default_lining").width height: childrenRect.height + UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
Column Column
{ {
height: childrenRect.height
anchors anchors
{ {
top: parent.top top: parent.top
right: parent.right right: parent.right
left: parent.left left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width margins: UM.Theme.getSize("default_margin").width
rightMargin: UM.Theme.getSize("default_margin").width
topMargin: UM.Theme.getSize("default_lining").width
bottomMargin: UM.Theme.getSize("default_lining").width
} }
Repeater Repeater
{ {
@ -70,32 +65,26 @@ ScrollView
} }
Label Label
{ {
visible: toolbox.materialsInstalledModel.items.length > 0
width: page.width
text: catalog.i18nc("@title:tab", "Materials") text: catalog.i18nc("@title:tab", "Materials")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
} }
Rectangle Rectangle
{ {
visible: toolbox.materialsInstalledModel.items.length > 0
color: "transparent" color: "transparent"
width: parent.width width: parent.width
height: childrenRect.height + 1 * UM.Theme.getSize("default_lining").width height: childrenRect.height + UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
Column Column
{ {
height: Math.max( UM.Theme.getSize("wide_margin").height, childrenRect.height)
anchors anchors
{ {
top: parent.top top: parent.top
right: parent.right right: parent.right
left: parent.left left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width margins: UM.Theme.getSize("default_margin").width
rightMargin: UM.Theme.getSize("default_margin").width
topMargin: UM.Theme.getSize("default_lining").width
bottomMargin: UM.Theme.getSize("default_lining").width
} }
Repeater Repeater
{ {