CURA-5137 Add filtering for materials and plugins and change the

behavior of switching tabs.
This commit is contained in:
Diego Prado Gesto 2018-04-03 17:07:33 +02:00
parent 1ad34495b4
commit b621b5ef6b
7 changed files with 85 additions and 51 deletions

View file

@ -14,7 +14,8 @@ import UM 1.1 as UM
Window
{
id: base
title: catalog.i18nc("@title:tab", "Plugins");
title: catalog.i18nc("@title:tab", "Toolbox");
modality: Qt.ApplicationModal
width: 800 * screenScaleFactor
height: 640 * screenScaleFactor
minimumWidth: 800 * screenScaleFactor
@ -42,18 +43,17 @@ Window
ToolboxViewDownloads
{
id: viewDownloads
visible: manager.viewing == "available" && manager.detailView == "" ? true : false
visible: manager.currentView != "installed" && !manager.detailView
}
ToolboxViewDetail
{
id: viewDetail
visible: manager.viewing == "available" && manager.detailView != "" ? true : false
visible: manager.currentView != "installed" && manager.detailView
}
ToolboxViewInstalled
{
id: installedPluginList
visible: manager.viewing == "installed" ? true : false
visible: manager.currentView == "installed"
}
}
SectionShadow

View file

@ -39,13 +39,10 @@ Rectangle
columnSpacing: UM.Theme.getSize("base_unit").width
rowSpacing: UM.Theme.getSize("base_unit").height
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}
Repeater
{
model: manager.packagesModel
delegate: ToolboxGridTile {}
}
}
}

View file

@ -33,7 +33,7 @@ Item
Label
{
id: name
text: "Auto Orientation"
text: model.name
width: parent.width
wrapMode: Text.WordWrap
height: UM.Theme.getSize("base_unit").height * 2
@ -44,7 +44,7 @@ Item
Label
{
id: info
text: "Automatically orientate your model."
text: model.description
width: parent.width
wrapMode: Text.WordWrap
color: UM.Theme.getColor("text_medium")
@ -55,8 +55,6 @@ Item
MouseArea
{
anchors.fill: parent
onClicked: {
manager.setDetailView("thingy")
}
onClicked: manager.detailView = true
}
}

View file

@ -32,7 +32,7 @@ Rectangle {
implicitWidth: 96
implicitHeight: 48
Rectangle {
visible: manager.viewing == "available" ? true : false
visible: manager.currentView == "plugins"
color: UM.Theme.getColor("primary")
anchors.bottom: parent.bottom
width: parent.width
@ -49,7 +49,11 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
}
}
onClicked: manager.setView("available")
onClicked:
{
manager.filterPackagesByType("plugin")
manager.currentView = "plugins"
}
}
Button {
@ -60,7 +64,7 @@ Rectangle {
implicitWidth: 96
implicitHeight: 48
Rectangle {
visible: manager.viewing == "available" ? true : false
visible: manager.currentView == "materials"
color: UM.Theme.getColor("primary")
anchors.bottom: parent.bottom
width: parent.width
@ -77,7 +81,11 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
}
}
onClicked: manager.setView("available")
onClicked:
{
manager.filterPackagesByType("material")
manager.currentView = "materials"
}
}
}
@ -91,7 +99,7 @@ Rectangle {
implicitWidth: 96
implicitHeight: 48
Rectangle {
visible: manager.viewing == "installed" ? true : false
visible: manager.currentView == "installed"
color: UM.Theme.getColor("primary")
anchors.bottom: parent.bottom
width: parent.width
@ -108,6 +116,6 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
}
}
onClicked: manager.setView("installed")
onClicked: manager.currentView = "installed"
}
}

View file

@ -29,9 +29,7 @@ Item
Button
{
text: "Back"
onClicked: {
manager.setDetailView("")
}
onClicked: manager.detailView = false
}
}
ScrollView