Implimented showcase

This commit is contained in:
Ian Paschal 2018-04-10 11:05:34 +02:00
parent 817b724994
commit 7359554641
7 changed files with 133 additions and 38 deletions

View file

@ -92,8 +92,10 @@ Item
topMargin: UM.Theme.getSize("double_margin").height
}
}
Column
Label
{
id: title
anchors
{
top: thumbnail.top
@ -101,29 +103,72 @@ Item
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("double_margin").width
bottomMargin: UM.Theme.getSize("default_margin").height
}
text: details.name
font: UM.Theme.getFont("large")
wrapMode: Text.WordWrap
width: parent.width
height: UM.Theme.getSize("base_unit") * 2
}
Column
{
id: properties
anchors
{
top: title.bottom
left: title.left
}
spacing: Math.floor(UM.Theme.getSize("default_margin").height / 2)
width: childrenRect.width
Label
{
text: "Version:"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
Label
{
text: "Last Update:"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
Label
{
text: "Author:"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
}
Column
{
id: values
anchors
{
top: title.bottom
left: properties.right
leftMargin: UM.Theme.getSize("default_margin").width
}
spacing: Math.floor(UM.Theme.getSize("default_margin").height/2)
width: UM.Theme.getSize("base_unit").width * 12
Label
{
text: details.name
font: UM.Theme.getFont("large")
wrapMode: Text.WordWrap
width: parent.width
text: details.version
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
}
Label
{
text: details.description
font: UM.Theme.getFont("default")
wrapMode: Text.WordWrap
width: parent.width
text: details.generated_time
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
}
Label
{
text: "Author: " + details.author_name
font: UM.Theme.getFont("small")
wrapMode: Text.WordWrap
width: parent.width
// TODO: Add mail icon.
text: details.author_name
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
}
}
}

View file

@ -19,7 +19,7 @@ Column
Label
{
id: heading
text: "Community Plugins"
text: manager.viewCategory == "material" ? "Maker Choices" : "Community Plugins"
width: parent.width
color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium")

View file

@ -26,6 +26,7 @@ Item
height: UM.Theme.getSize("toolbox_thumbnail_small").height
color: "white"
border.width: 1
border.color: UM.Theme.getColor("text_medium")
Image {
anchors.centerIn: parent
width: UM.Theme.getSize("toolbox_thumbnail_small").width - 26
@ -79,7 +80,6 @@ Item
manager.viewSelection = model.id
manager.viewPage = "detail"
manager.filterPackages("id", model.id)
}
}
}

View file

@ -7,8 +7,6 @@ import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM
// TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles
ScrollView
{
id: base
@ -19,8 +17,8 @@ ScrollView
Column
{
width: base.width
spacing: UM.Theme.getSize("base_unit").height
padding: UM.Theme.getSize("base_unit").height * 2
spacing: UM.Theme.getSize("default_margin").height
padding: UM.Theme.getSize("double_margin").height
height: childrenRect.height + 2 * padding
ToolboxDownloadsShowcase
{
@ -31,7 +29,7 @@ ScrollView
{
color: UM.Theme.getColor("text_medium")
width: parent.width - 2 * parent.padding
height: UM.Theme.getSize("base_unit").height / 6
height: UM.Theme.getSize("default_lining").height
}
ToolboxDownloadsGrid
{

View file

@ -18,7 +18,7 @@ Column
Label
{
id: heading
text: "Showcase"
text: "Featured"
width: parent.width
color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium")
@ -32,8 +32,10 @@ Column
horizontalCenter: parent.horizontalCenter
}
ToolboxDownloadsShowcaseTile {}
ToolboxDownloadsShowcaseTile {}
ToolboxDownloadsShowcaseTile {}
Repeater
{
model: manager.materialShowcaseModel
delegate: ToolboxDownloadsShowcaseTile {}
}
}
}

View file

@ -15,18 +15,26 @@ Item
Rectangle
{
color: "white"
width: UM.Theme.getSize("base_unit").width * 8
height: UM.Theme.getSize("base_unit").width * 8
width: UM.Theme.getSize("toolbox_thumbnail_medium").width
height: UM.Theme.getSize("toolbox_thumbnail_medium").height
border.width: 1
border.color: UM.Theme.getColor("text_medium")
anchors
{
top: parent.top
horizontalCenter: parent.horizontalCenter
}
Image {
anchors.centerIn: parent
width: UM.Theme.getSize("toolbox_thumbnail_medium").width - 26
height: UM.Theme.getSize("toolbox_thumbnail_medium").height - 26
fillMode: Image.PreserveAspectFit
source: model.icon_url || "../images/logobot.svg"
}
}
Label
{
text: "Solidworks Integration"
text: model.name
anchors
{
bottom: parent.bottom
@ -39,4 +47,22 @@ Item
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium_bold")
}
MouseArea
{
anchors.fill: parent
onClicked: {
if ( manager.viewCategory == "material" )
{
manager.viewSelection = model.name
manager.viewPage = "author"
manager.filterPackages("author_name", model.name)
}
else
{
manager.viewSelection = model.id
manager.viewPage = "detail"
manager.filterPackages("id", model.id)
}
}
}
}