mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:29:01 +08:00
Merge pull request #6549 from Ultimaker/CURA-6897_qml_warnings_materials_page
CURA-6897_qml_warnings_materials_page
This commit is contained in:
commit
4aadcba01c
@ -10,6 +10,8 @@ import QtQuick.Dialogs 1.2
|
|||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
|
// An expandable list of materials. Includes both the header (this file) and the items (brandMaterialList)
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: brand_section
|
id: brand_section
|
||||||
@ -50,9 +52,8 @@ Item
|
|||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
leftPadding: (UM.Theme.getSize("default_margin").width / 2) | 0
|
leftPadding: (UM.Theme.getSize("default_margin").width / 2) | 0
|
||||||
}
|
}
|
||||||
Button
|
Item
|
||||||
{
|
{
|
||||||
text: ""
|
|
||||||
implicitWidth: UM.Theme.getSize("favorites_button").width
|
implicitWidth: UM.Theme.getSize("favorites_button").width
|
||||||
implicitHeight: UM.Theme.getSize("favorites_button").height
|
implicitHeight: UM.Theme.getSize("favorites_button").height
|
||||||
UM.RecolorImage
|
UM.RecolorImage
|
||||||
@ -67,10 +68,6 @@ Item
|
|||||||
color: "black"
|
color: "black"
|
||||||
source: brand_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
source: brand_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
||||||
}
|
}
|
||||||
style: ButtonStyle
|
|
||||||
{
|
|
||||||
background: Item { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea
|
MouseArea
|
||||||
@ -99,7 +96,7 @@ Item
|
|||||||
id: brandMaterialList
|
id: brandMaterialList
|
||||||
anchors.top: brand_header.bottom
|
anchors.top: brand_header.bottom
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.left: parent.left
|
anchors.left: parent ? parent.left : undefined
|
||||||
height: brand_section.expanded ? childrenRect.height : 0
|
height: brand_section.expanded ? childrenRect.height : 0
|
||||||
visible: brand_section.expanded
|
visible: brand_section.expanded
|
||||||
|
|
||||||
@ -109,7 +106,7 @@ Item
|
|||||||
delegate: Loader
|
delegate: Loader
|
||||||
{
|
{
|
||||||
id: loader
|
id: loader
|
||||||
width: parent.width
|
width: parent ? parent.width : 0
|
||||||
property var element: model
|
property var element: model
|
||||||
sourceComponent: hasMaterialTypes ? materialsTypeSection : materialSlot
|
sourceComponent: hasMaterialTypes ? materialsTypeSection : materialSlot
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ import QtQuick.Dialogs 1.2
|
|||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
|
// A single material row, typically used in a MaterialsBrandSection
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: materialSlot
|
id: materialSlot
|
||||||
|
@ -20,8 +20,8 @@ Item
|
|||||||
property var expanded: materialList.expandedTypes.indexOf(materialBrand + "_" + materialName) > -1
|
property var expanded: materialList.expandedTypes.indexOf(materialBrand + "_" + materialName) > -1
|
||||||
property var colorsModel: materialType != null ? materialType.colors: null
|
property var colorsModel: materialType != null ? materialType.colors: null
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: parent.width
|
width: parent ? parent.width :undefined
|
||||||
anchors.left: parent.left
|
anchors.left: parent ? parent.left : undefined
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: material_type_header_background
|
id: material_type_header_background
|
||||||
@ -55,7 +55,7 @@ Item
|
|||||||
leftPadding: UM.Theme.getSize("default_margin").width
|
leftPadding: UM.Theme.getSize("default_margin").width
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
left: parent.left
|
left: parent ? parent.left : undefined
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@ -65,33 +65,25 @@ Item
|
|||||||
id: material_type_name
|
id: material_type_name
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
Button
|
Item // this one causes lots of warnings
|
||||||
{
|
{
|
||||||
text: ""
|
|
||||||
implicitWidth: UM.Theme.getSize("favorites_button").width
|
implicitWidth: UM.Theme.getSize("favorites_button").width
|
||||||
implicitHeight: UM.Theme.getSize("favorites_button").height
|
implicitHeight: UM.Theme.getSize("favorites_button").height
|
||||||
UM.RecolorImage {
|
UM.RecolorImage {
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent ? parent.verticalCenter : undefined
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent ? parent.horizontalCenter : undefined
|
||||||
}
|
}
|
||||||
width: UM.Theme.getSize("standard_arrow").width
|
width: UM.Theme.getSize("standard_arrow").width
|
||||||
height: UM.Theme.getSize("standard_arrow").height
|
height: UM.Theme.getSize("standard_arrow").height
|
||||||
color: "black"
|
color: "black"
|
||||||
source: material_type_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
source: material_type_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
||||||
}
|
}
|
||||||
style: ButtonStyle
|
|
||||||
{
|
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
anchors.fill: parent
|
|
||||||
color: "transparent"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
MouseArea // causes lots of warnings
|
||||||
}
|
|
||||||
MouseArea
|
|
||||||
{
|
{
|
||||||
anchors.fill: material_type_header
|
anchors.fill: material_type_header
|
||||||
onPressed:
|
onPressed:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user