diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index 8393eb045c..d770b7c74e 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -7,8 +7,6 @@ import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.1 as UM -// TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles - Column { height: childrenRect.height @@ -25,14 +23,14 @@ Column GridLayout { id: grid + property var model: toolbox.viewCategory == "material" ? toolbox.authorsModel : toolbox.packagesModel width: parent.width columns: 2 columnSpacing: UM.Theme.getSize("default_margin").height rowSpacing: UM.Theme.getSize("default_margin").width - height: childrenRect.height Repeater { - model: toolbox.viewCategory == "material" ? toolbox.authorsModel : toolbox.packagesModel + model: grid.model delegate: ToolboxDownloadsGridTile { Layout.preferredWidth: (grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index f665d5c5f5..170fd10fc7 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -8,32 +8,31 @@ import UM 1.1 as UM ScrollView { - id: page frameVisible: false width: parent.width height: parent.height style: UM.Theme.styles.scrollview Column { - width: page.width + width: parent.width - 2 * padding spacing: UM.Theme.getSize("default_margin").height padding: UM.Theme.getSize("wide_margin").height height: childrenRect.height + 2 * padding ToolboxDownloadsShowcase { id: showcase - width: parent.width - 2 * parent.padding + width: parent.width } Rectangle { color: UM.Theme.getColor("lining") - width: parent.width - 2 * parent.padding + width: parent.width height: UM.Theme.getSize("default_lining").height } ToolboxDownloadsGrid { id: allPlugins - width: parent.width - 2 * parent.padding + width: parent.width } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 57dc16a4b8..1621340184 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Item { width: UM.Theme.getSize("toolbox_thumbnail_large").width - height: UM.Theme.getSize("toolbox_thumbnail_large").width + height: childrenRect.height visible: { if (toolbox.viewCategory == "material" && model.packages_count) @@ -23,9 +23,17 @@ Item } Rectangle { + id: highlight + anchors.fill: parent + opacity: 0.0 + color: UM.Theme.getColor("primary") + } + Rectangle + { + id: thumbnail color: "white" - width: UM.Theme.getSize("toolbox_thumbnail_medium").width - height: UM.Theme.getSize("toolbox_thumbnail_medium").height + width: UM.Theme.getSize("toolbox_thumbnail_large").width + height: UM.Theme.getSize("toolbox_thumbnail_large").height border { width: UM.Theme.getSize("default_lining").width @@ -38,8 +46,8 @@ Item } Image { anchors.centerIn: parent - width: UM.Theme.getSize("toolbox_thumbnail_medium").width - 2 * UM.Theme.getSize("default_margin") - height: UM.Theme.getSize("toolbox_thumbnail_medium").height - 2 * UM.Theme.getSize("default_margin") + width: UM.Theme.getSize("toolbox_thumbnail_large").width - 2 * UM.Theme.getSize("default_margin").width + height: UM.Theme.getSize("toolbox_thumbnail_large").height - 2 * UM.Theme.getSize("default_margin").height fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" } @@ -56,12 +64,24 @@ Item horizontalAlignment: Text.AlignHCenter height: UM.Theme.getSize("toolbox_heading_label").height width: parent.width + wrapMode: Text.WordWrap color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium_bold") } MouseArea { anchors.fill: parent + hoverEnabled: true + onEntered: + { + thumbnail.border.color = UM.Theme.getColor("primary") + highlight.opacity = 0.1 + } + onExited: + { + thumbnail.border.color = UM.Theme.getColor("lining") + highlight.opacity = 0.0 + } onClicked: { base.selection = model