Simplify sectionHeading element

No need to define that component in a higher location, just define it where you need it. Also, no need to use a Rectangle for this if it has no colour, just use an Item, but the Item itself is also not necessary if you just need the padding.

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-11-26 17:19:32 +01:00
parent 3b219e3ac3
commit a03e1be601
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -25,21 +25,6 @@ Column
}
}
Component
{
id: sectionHeading
Rectangle
{
height: childrenRect.height + UM.Theme.getSize("default_margin").height
Label
{
text: section
font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("configuration_item_text")
}
}
}
ScrollView
{
id: container
@ -58,7 +43,13 @@ Column
section.property: "modelData.printerType"
section.criteria: ViewSection.FullString
section.delegate: sectionHeading
section.delegate: Label
{
text: section
font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("configuration_item_text")
bottomPadding: UM.Theme.getSize("default_margin").height
}
model: (outputDevice != null) ? outputDevice.uniqueConfigurations : []
delegate: ConfigurationItem