mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Fix technical data sheet not showing if there is no support_configs
This commit is contained in:
parent
69c9ffaf61
commit
d3302938b2
1 changed files with 131 additions and 113 deletions
|
@ -15,141 +15,159 @@ Item
|
||||||
var link = undefined
|
var link = undefined
|
||||||
if ("Technical Data Sheet" in packageData.links)
|
if ("Technical Data Sheet" in packageData.links)
|
||||||
{
|
{
|
||||||
|
// HACK: This is the way the old API (used in 3.6-beta) used to do it. For safety it's still here,
|
||||||
|
// but it can be removed over time.
|
||||||
link = packageData.links["Technical Data Sheet"]
|
link = packageData.links["Technical Data Sheet"]
|
||||||
}
|
}
|
||||||
|
else if ("technicalDataSheet" in packageData.links)
|
||||||
|
{
|
||||||
|
link = packageData.links["technicalDataSheet"]
|
||||||
|
}
|
||||||
return link
|
return link
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
height: visible ? childrenRect.height : 0
|
height: visible ? childrenRect.height : 0
|
||||||
visible: packageData.type == "material" && packageData.has_configs
|
|
||||||
Label
|
visible: packageData.type == "material" && (packageData.has_configs || technicalDataSheetUrl != undefined)
|
||||||
|
|
||||||
|
Item
|
||||||
{
|
{
|
||||||
id: heading
|
id: combatibilityItem
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
visible: packageData.has_configs
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: catalog.i18nc("@label", "Compatibility")
|
// This is a bit of a hack, but the whole QML is pretty messy right now. This needs a big overhaul.
|
||||||
wrapMode: Text.WordWrap
|
height: visible ? heading.height + table.height: 0
|
||||||
color: UM.Theme.getColor("text_medium")
|
|
||||||
font: UM.Theme.getFont("medium")
|
|
||||||
}
|
|
||||||
TableView
|
|
||||||
{
|
|
||||||
id: table
|
|
||||||
anchors.top: heading.bottom
|
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
width: parent.width
|
|
||||||
frameVisible: false
|
|
||||||
|
|
||||||
// Workaround for scroll issues (QTBUG-49652)
|
Label
|
||||||
flickableItem.interactive: false
|
|
||||||
Component.onCompleted:
|
|
||||||
{
|
{
|
||||||
for (var i = 0; i < flickableItem.children.length; ++i)
|
id: heading
|
||||||
{
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
flickableItem.children[i].enabled = false
|
width: parent.width
|
||||||
}
|
text: catalog.i18nc("@label", "Compatibility")
|
||||||
}
|
wrapMode: Text.WordWrap
|
||||||
selectionMode: 0
|
color: UM.Theme.getColor("text_medium")
|
||||||
model: packageData.supported_configs
|
font: UM.Theme.getFont("medium")
|
||||||
headerDelegate: Rectangle
|
|
||||||
{
|
|
||||||
color: UM.Theme.getColor("sidebar")
|
|
||||||
height: UM.Theme.getSize("toolbox_chart_row").height
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
elide: Text.ElideRight
|
|
||||||
text: styleData.value || ""
|
|
||||||
color: UM.Theme.getColor("text")
|
|
||||||
font: UM.Theme.getFont("default_bold")
|
|
||||||
}
|
|
||||||
Rectangle
|
|
||||||
{
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
height: UM.Theme.getSize("default_lining").height
|
|
||||||
width: parent.width
|
|
||||||
color: "black"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rowDelegate: Item
|
|
||||||
{
|
|
||||||
height: UM.Theme.getSize("toolbox_chart_row").height
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
elide: Text.ElideRight
|
|
||||||
text: styleData.value || ""
|
|
||||||
color: UM.Theme.getColor("text_medium")
|
|
||||||
font: UM.Theme.getFont("default")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
itemDelegate: Item
|
|
||||||
{
|
|
||||||
height: UM.Theme.getSize("toolbox_chart_row").height
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
elide: Text.ElideRight
|
|
||||||
text: styleData.value || ""
|
|
||||||
color: UM.Theme.getColor("text_medium")
|
|
||||||
font: UM.Theme.getFont("default")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component
|
TableView
|
||||||
{
|
{
|
||||||
id: columnTextDelegate
|
id: table
|
||||||
Label
|
anchors.top: heading.bottom
|
||||||
{
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
anchors.fill: parent
|
width: parent.width
|
||||||
verticalAlignment: Text.AlignVCenter
|
frameVisible: false
|
||||||
text: styleData.value || ""
|
|
||||||
elide: Text.ElideRight
|
|
||||||
color: UM.Theme.getColor("text_medium")
|
|
||||||
font: UM.Theme.getFont("default")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TableViewColumn
|
// Workaround for scroll issues (QTBUG-49652)
|
||||||
{
|
flickableItem.interactive: false
|
||||||
role: "machine"
|
Component.onCompleted:
|
||||||
title: "Machine"
|
{
|
||||||
width: Math.floor(table.width * 0.25)
|
for (var i = 0; i < flickableItem.children.length; ++i)
|
||||||
delegate: columnTextDelegate
|
{
|
||||||
}
|
flickableItem.children[i].enabled = false
|
||||||
TableViewColumn
|
}
|
||||||
{
|
}
|
||||||
role: "print_core"
|
selectionMode: 0
|
||||||
title: "Print Core"
|
model: packageData.supported_configs
|
||||||
width: Math.floor(table.width * 0.2)
|
headerDelegate: Rectangle
|
||||||
}
|
{
|
||||||
TableViewColumn
|
color: UM.Theme.getColor("sidebar")
|
||||||
{
|
height: UM.Theme.getSize("toolbox_chart_row").height
|
||||||
role: "build_plate"
|
Label
|
||||||
title: "Build Plate"
|
{
|
||||||
width: Math.floor(table.width * 0.225)
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
elide: Text.ElideRight
|
||||||
TableViewColumn
|
text: styleData.value || ""
|
||||||
{
|
color: UM.Theme.getColor("text")
|
||||||
role: "support_material"
|
font: UM.Theme.getFont("default_bold")
|
||||||
title: "Support"
|
}
|
||||||
width: Math.floor(table.width * 0.225)
|
Rectangle
|
||||||
}
|
{
|
||||||
TableViewColumn
|
anchors.bottom: parent.bottom
|
||||||
{
|
height: UM.Theme.getSize("default_lining").height
|
||||||
role: "quality"
|
width: parent.width
|
||||||
title: "Quality"
|
color: "black"
|
||||||
width: Math.floor(table.width * 0.1)
|
}
|
||||||
|
}
|
||||||
|
rowDelegate: Item
|
||||||
|
{
|
||||||
|
height: UM.Theme.getSize("toolbox_chart_row").height
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
elide: Text.ElideRight
|
||||||
|
text: styleData.value || ""
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemDelegate: Item
|
||||||
|
{
|
||||||
|
height: UM.Theme.getSize("toolbox_chart_row").height
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
elide: Text.ElideRight
|
||||||
|
text: styleData.value || ""
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component
|
||||||
|
{
|
||||||
|
id: columnTextDelegate
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
text: styleData.value || ""
|
||||||
|
elide: Text.ElideRight
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "machine"
|
||||||
|
title: "Machine"
|
||||||
|
width: Math.floor(table.width * 0.25)
|
||||||
|
delegate: columnTextDelegate
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "print_core"
|
||||||
|
title: "Print Core"
|
||||||
|
width: Math.floor(table.width * 0.2)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "build_plate"
|
||||||
|
title: "Build Plate"
|
||||||
|
width: Math.floor(table.width * 0.225)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "support_material"
|
||||||
|
title: "Support"
|
||||||
|
width: Math.floor(table.width * 0.225)
|
||||||
|
}
|
||||||
|
TableViewColumn
|
||||||
|
{
|
||||||
|
role: "quality"
|
||||||
|
title: "Quality"
|
||||||
|
width: Math.floor(table.width * 0.1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: technical_data_sheet
|
id: technical_data_sheet
|
||||||
anchors.top: table.bottom
|
anchors.top: combatibilityItem.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height / 2
|
anchors.topMargin: UM.Theme.getSize("default_margin").height / 2
|
||||||
visible: base.technicalDataSheetUrl !== undefined
|
visible: base.technicalDataSheetUrl !== undefined
|
||||||
|
height: visible ? contentHeight : 0
|
||||||
text:
|
text:
|
||||||
{
|
{
|
||||||
if (base.technicalDataSheetUrl !== undefined)
|
if (base.technicalDataSheetUrl !== undefined)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue