CURA-5035 Separate API calls!

This commit is contained in:
Ian Paschal 2018-04-30 16:42:11 +02:00
parent 679f87ebb3
commit 01007946b4
10 changed files with 185 additions and 186 deletions

View file

@ -48,7 +48,6 @@ Item
{
toolbox.viewPage = "overview"
toolbox.filterModelByProp("packages", "type", toolbox.viewCategory)
toolbox.filterModelByProp("authors", "type", toolbox.viewCategory)
}
style: ButtonStyle
{

View file

@ -6,10 +6,9 @@ import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM
Rectangle
Item
{
id: detailList
// color: "green"
ScrollView
{
frameVisible: false
@ -24,6 +23,8 @@ Rectangle
bottomMargin: UM.Theme.getSize("wide_margin").height
top: parent.top
}
// TODO: Sometimes the height is not the childrenRect.height. Lord
// knows why. Probably because QT is garbage.
height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").height
Repeater

View file

@ -11,9 +11,14 @@ Item
id: tile
property bool installed: toolbox.isInstalled(model.id)
width: detailList.width - UM.Theme.getSize("wide_margin").width
height: UM.Theme.getSize("toolbox_detail_tile").height
Column
// TODO: Without this line, every instance of this object has 0 height. With
// it, QML spits out tons of bugs claiming a binding loop (not true). Why?
// Because QT is garbage.
height: Math.max( UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height)
Item
{
id: normalData
height: childrenRect.height
anchors
{
left: parent.left
@ -23,15 +28,17 @@ Item
}
Label
{
id: packageName
width: parent.width
height: UM.Theme.getSize("toolbox_property_label").height
text: model.name
wrapMode: Text.WordWrap
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default_bold")
font: UM.Theme.getFont("medium_bold")
}
Label
{
anchors.top: packageName.bottom
width: parent.width
text:
{
@ -53,13 +60,13 @@ Item
font: UM.Theme.getFont("default")
}
}
Rectangle
Item
{
id: controls
anchors.right: tile.right
anchors.top: tile.top
width: childrenRect.width
color: "blue"
height: childrenRect.height
Button
{
id: installButton
@ -179,6 +186,78 @@ Item
}
}
}
Item
{
anchors.top: normalData.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
height: model.type == "material" ? childrenRect.height : 0
width: normalData.width
visible: model.type == "material"
Label
{
id: compatibilityHeading
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
text: catalog.i18nc("@label", "Compatibility")
wrapMode: Text.WordWrap
color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("default")
}
Column
{
id: compatibilityLabels
anchors
{
top: compatibilityHeading.bottom
topMargin: UM.Theme.getSize("default_margin").height
bottomMargin: UM.Theme.getSize("default_margin").height
}
width: childrenRect.width
Label
{
text: catalog.i18nc("@label", "Machines") + ":"
font: UM.Theme.getFont("small")
}
Label
{
text: catalog.i18nc("@label", "Print Cores") + ":"
font: UM.Theme.getFont("small")
}
Label
{
text: catalog.i18nc("@label", "Quality Profiles") + ":"
font: UM.Theme.getFont("small")
}
}
Column
{
id: compatibilityValues
anchors
{
left: compatibilityLabels.right
leftMargin: UM.Theme.getSize("default_margin").height
top: compatibilityLabels.top
bottom: compatibilityLabels.bottom
}
Label
{
text: "Thingy"
font: UM.Theme.getFont("very_small")
}
Label
{
text: "Thingy"
font: UM.Theme.getFont("very_small")
}
Label
{
text: "Thingy"
font: UM.Theme.getFont("very_small")
}
}
}
Rectangle
{
color: UM.Theme.getColor("lining")

View file

@ -92,7 +92,7 @@ Item
{
case "material":
toolbox.viewPage = "author"
toolbox.filterModelByProp("packages", "author_name", model.name)
toolbox.filterModelByProp("packages", "author_id", model.id)
break
default:
toolbox.viewPage = "detail"

View file

@ -10,17 +10,6 @@ Item
{
width: UM.Theme.getSize("toolbox_thumbnail_large").width
height: childrenRect.height
visible:
{
if (toolbox.viewCategory == "material" && model.packages_count)
{
return model.packages_count > 0
}
else
{
return true
}
}
Rectangle
{
id: highlight

View file

@ -38,7 +38,7 @@ Item
active: toolbox.viewCategory == "material"
onClicked:
{
toolbox.filterModelByProp("authors", "type", "material")
toolbox.filterModelByProp("authors", "package_types", "material")
toolbox.viewCategory = "material"
toolbox.viewPage = "overview"
}