mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 00:37:50 -06:00
Change links and compatibility chart.
This commit is contained in:
parent
1736a02d28
commit
c3f3b8dd93
3 changed files with 36 additions and 70 deletions
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Toolbox is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
Item
|
||||
|
@ -11,52 +11,19 @@ Item
|
|||
id: base
|
||||
|
||||
property var packageData
|
||||
property var technicalDataSheetUrl:
|
||||
{
|
||||
var link = undefined
|
||||
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"]
|
||||
}
|
||||
else if ("technicalDataSheet" in packageData.links)
|
||||
{
|
||||
link = packageData.links["technicalDataSheet"]
|
||||
}
|
||||
return link
|
||||
}
|
||||
property var safetyDataSheetUrl:
|
||||
{
|
||||
var sds_name = "safetyDataSheet"
|
||||
return (sds_name in packageData.links) ? packageData.links[sds_name] : undefined
|
||||
}
|
||||
property var printingGuidelinesUrl:
|
||||
{
|
||||
var pg_name = "printingGuidelines"
|
||||
return (pg_name in packageData.links) ? packageData.links[pg_name] : undefined
|
||||
}
|
||||
property var technicalDataSheetUrl: packageData.links.technicalDataSheet
|
||||
property var safetyDataSheetUrl: packageData.links.safetyDataSheet
|
||||
property var printingGuidelinesUrl: packageData.links.printingGuidelines
|
||||
property var materialWebsiteUrl: packageData.links.website
|
||||
|
||||
property var materialWebsiteUrl:
|
||||
{
|
||||
var pg_name = "website"
|
||||
return (pg_name in packageData.links) ? packageData.links[pg_name] : undefined
|
||||
}
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
height: visible ? childrenRect.height : 0
|
||||
|
||||
visible: packageData.type == "material" &&
|
||||
(packageData.has_configs || technicalDataSheetUrl !== undefined ||
|
||||
safetyDataSheetUrl !== undefined || printingGuidelinesUrl !== undefined ||
|
||||
materialWebsiteUrl !== undefined)
|
||||
height: childrenRect.height
|
||||
onVisibleChanged: packageData.type == "material" && (compatibilityItem.visible || dataSheetLinks.visible)
|
||||
|
||||
Item
|
||||
{
|
||||
id: combatibilityItem
|
||||
id: compatibilityItem
|
||||
visible: packageData.has_configs
|
||||
width: parent.width
|
||||
// This is a bit of a hack, but the whole QML is pretty messy right now. This needs a big overhaul.
|
||||
height: visible ? heading.height + table.height: 0
|
||||
|
||||
Label
|
||||
{
|
||||
|
@ -155,32 +122,32 @@ Item
|
|||
TableViewColumn
|
||||
{
|
||||
role: "machine"
|
||||
title: "Machine"
|
||||
title: catalog.i18nc("@label table header", "Machine")
|
||||
width: Math.floor(table.width * 0.25)
|
||||
delegate: columnTextDelegate
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
role: "print_core"
|
||||
title: "Print Core"
|
||||
title: catalog.i18nc("@label table header", "Print Core")
|
||||
width: Math.floor(table.width * 0.2)
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
role: "build_plate"
|
||||
title: "Build Plate"
|
||||
title: catalog.i18nc("@label table header", "Build Plate")
|
||||
width: Math.floor(table.width * 0.225)
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
role: "support_material"
|
||||
title: "Support"
|
||||
title: catalog.i18nc("@label table header", "Support")
|
||||
width: Math.floor(table.width * 0.225)
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
role: "quality"
|
||||
title: "Quality"
|
||||
title: catalog.i18nc("@label table header", "Quality")
|
||||
width: Math.floor(table.width * 0.1)
|
||||
}
|
||||
}
|
||||
|
@ -188,13 +155,14 @@ Item
|
|||
|
||||
Label
|
||||
{
|
||||
id: data_sheet_links
|
||||
anchors.top: combatibilityItem.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height / 2
|
||||
id: dataSheetLinks
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: UM.Theme.getSize("narrow_margin").height
|
||||
visible: base.technicalDataSheetUrl !== undefined ||
|
||||
base.safetyDataSheetUrl !== undefined || base.printingGuidelinesUrl !== undefined ||
|
||||
base.materialWebsiteUrl !== undefined
|
||||
height: visible ? contentHeight : 0
|
||||
base.safetyDataSheetUrl !== undefined ||
|
||||
base.printingGuidelinesUrl !== undefined ||
|
||||
base.materialWebsiteUrl !== undefined
|
||||
|
||||
text:
|
||||
{
|
||||
var result = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue