diff --git a/plugins/Toolbox/resources/images/logobot.svg b/plugins/Toolbox/resources/images/logobot.svg new file mode 100644 index 0000000000..8234f66887 --- /dev/null +++ b/plugins/Toolbox/resources/images/logobot.svg @@ -0,0 +1,161 @@ + + + + +logo +Created with Sketch. + + + + + + + + + + + + diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index eb56cf02b1..3803dff2ab 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -17,10 +17,10 @@ Window property bool dataReady: manager.dataReady title: catalog.i18nc("@title:tab", "Toolbox"); modality: Qt.ApplicationModal - width: 800 * screenScaleFactor + width: 960 * screenScaleFactor height: 640 * screenScaleFactor - minimumWidth: 800 * screenScaleFactor - maximumWidth: 800 * screenScaleFactor + minimumWidth: 960 * screenScaleFactor + maximumWidth: 960 * screenScaleFactor minimumHeight: 350 * screenScaleFactor color: UM.Theme.getColor("sidebar") Item diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml index a57a6de90c..2f152e5859 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml @@ -72,12 +72,13 @@ Item right: parent.right } height: UM.Theme.getSize("base_unit").height * 12 - Rectangle + Image { id: thumbnail width: UM.Theme.getSize("toolbox_thumbnail_medium").width height: UM.Theme.getSize("toolbox_thumbnail_medium").height - color: "grey" + fillMode: Image.PreserveAspectFit + source: manager.detailData["icon_url"] || "../images/logobot.svg" anchors { top: parent.top @@ -99,21 +100,21 @@ Item spacing: Math.floor(UM.Theme.getSize("default_margin").height/2) Label { - text: "DSM" + text: manager.detailData["type"] == "material" ? manager.detailData["author"] : manager.detailData["name"] font: UM.Theme.getFont("large") wrapMode: Text.WordWrap width: parent.width } Label { - text: "Sets the horizontal and vertical alignment of the text within the Text items width and height. By default, the text is vertically aligned to the top." + text: manager.detailData["description"] font: UM.Theme.getFont("default") wrapMode: Text.WordWrap width: parent.width } Label { - text: "Author: " + "DSM" + text: "Author: " + manager.detailData["author"]["name"] font: UM.Theme.getFont("small") wrapMode: Text.WordWrap width: parent.width diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index c3795daf51..9cdcb4e400 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -26,6 +26,13 @@ Item height: UM.Theme.getSize("toolbox_thumbnail_small").height color: "white" border.width: 1 + Image { + anchors.centerIn: parent + width: UM.Theme.getSize("toolbox_thumbnail_small").width - 26 + height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26 + fillMode: Image.PreserveAspectFit + source: model.icon_url || "../images/logobot.svg" + } } Column { diff --git a/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml b/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml index 08c5e759b8..ab95bddef6 100644 --- a/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml +++ b/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml @@ -6,9 +6,6 @@ import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 - -// TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles - import UM 1.1 as UM Window { diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index b2b1f8e53f..bca58ac4a4 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -302,7 +302,7 @@ class Toolbox(QObject, Extension): self._detail_view = bool self.detailViewChanged.emit() - @pyqtProperty(str, fset = setDetailView, notify = detailViewChanged) + @pyqtProperty(bool, fset = setDetailView, notify = detailViewChanged) def detailView(self): return self._detail_view @@ -311,13 +311,13 @@ class Toolbox(QObject, Extension): def setDetailData(self, id): if not self._packages_model: return - for plugin in self._plugins_model.items: - if plugin.id is id: - print(plugin) - self._detail_view = plugin + for package in self._packages_model.items: + if package["id"] == id: + print(package) + self._detail_data = package self.detailViewChanged.emit() - @pyqtProperty(QObject, notify = detailViewChanged) + @pyqtProperty("QVariantMap", notify = detailViewChanged) def detailData(self): return self._detail_data @@ -336,7 +336,10 @@ class Toolbox(QObject, Extension): for item in self._packages_metadata: if item["id"] == plugin["id"]: plugin["update_url"] = item["file_location"] - + if self._current_view == "plugins": + self.filterPackagesByType("plugin") + elif self._current_view == "materials": + self.filterPackagesByType("material") return self._plugins_model @pyqtProperty(QObject, notify = packagesMetadataChanged)