mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Reuse MaterialBrandSection component for Favorites, Generic and branded
materials. This component will show different children depending on the hasMaterialTypes flag. Adjust some small UI issues. Contributes to CURA-5682.
This commit is contained in:
parent
f871a89825
commit
bafc2b98c9
6 changed files with 61 additions and 148 deletions
|
|
@ -48,7 +48,7 @@ Rectangle
|
|||
height: UM.Theme.getSize("favorites_row").height
|
||||
width: parent.width - UM.Theme.getSize("favorites_button").width
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: 4
|
||||
leftPadding: (UM.Theme.getSize("default_margin").width / 2) | 0
|
||||
}
|
||||
Button
|
||||
{
|
||||
|
|
@ -101,6 +101,7 @@ Rectangle
|
|||
}
|
||||
Column
|
||||
{
|
||||
id: brandMaterialList
|
||||
anchors.top: brand_header.bottom
|
||||
width: parent.width
|
||||
anchors.left: parent.left
|
||||
|
|
@ -110,26 +111,14 @@ Rectangle
|
|||
Repeater
|
||||
{
|
||||
model: elementsModel
|
||||
delegate: Item
|
||||
delegate: Loader
|
||||
{
|
||||
Loader
|
||||
{
|
||||
id: loader
|
||||
property var element: model
|
||||
sourceComponent: hasMaterialTypes ? materialsTypeSection : materialSlot
|
||||
}
|
||||
id: loader
|
||||
width: parent.width
|
||||
property var element: model
|
||||
sourceComponent: hasMaterialTypes ? materialsTypeSection : materialSlot
|
||||
}
|
||||
}
|
||||
// In case there are no types, we create a material slot
|
||||
// Repeater
|
||||
// {
|
||||
// model: elementsModel
|
||||
// delegate: MaterialsSlot
|
||||
// {
|
||||
// visible: !hasMaterialTypes
|
||||
// material: model
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
Component
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue