diff --git a/plugins/Toolbox/__init__.py b/plugins/Toolbox/__init__.py index dc2d6c9c23..2f8e192764 100644 --- a/plugins/Toolbox/__init__.py +++ b/plugins/Toolbox/__init__.py @@ -1,7 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Toolbox is released under the terms of the LGPLv3 or higher. -from .Toolbox import Toolbox +from .src import Toolbox def getMetaData(): diff --git a/plugins/Toolbox/resources/qml/PluginBrowser.qml b/plugins/Toolbox/resources/qml/Toolbox.qml similarity index 90% rename from plugins/Toolbox/resources/qml/PluginBrowser.qml rename to plugins/Toolbox/resources/qml/Toolbox.qml index c2ce4975f4..b7f0c44a98 100644 --- a/plugins/Toolbox/resources/qml/PluginBrowser.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -40,23 +40,23 @@ Window top: topBar.bottom bottom: bottomBar.top } - ToolboxViewDownloads + ToolboxDownloadsPage { id: viewDownloads - visible: manager.currentView != "installed" && !manager.detailView + visible: manager.currentView != "installed" && manager.detailView == "" } - ToolboxViewDetail + ToolboxDetailsPage { id: viewDetail - visible: manager.currentView != "installed" && manager.detailView + visible: manager.currentView != "installed" && manager.detailView != "" } - ToolboxViewInstalled + ToolboxInstalledPage { id: installedPluginList visible: manager.currentView == "installed" } } - SectionShadow + ToolboxShadow { anchors { @@ -67,7 +67,7 @@ Window { id: bottomBar } - SectionShadow + ToolboxShadow { anchors { diff --git a/plugins/Toolbox/resources/qml/ToolboxViewDetail.qml b/plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml similarity index 92% rename from plugins/Toolbox/resources/qml/ToolboxViewDetail.qml rename to plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml index dec4ddc1e6..d85d2559e8 100644 --- a/plugins/Toolbox/resources/qml/ToolboxViewDetail.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailsPage.qml @@ -44,7 +44,7 @@ Item } width: UM.Theme.getSize("base_unit").width * 4 height: UM.Theme.getSize("base_unit").height * 2 - onClicked: manager.detailView = false + onClicked: manager.detailView = "" style: ButtonStyle { background: Rectangle @@ -153,17 +153,17 @@ Item rightMargin: UM.Theme.getSize("double_margin").width } - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} - ToolboxDetailTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} + ToolboxDetailsTile {} } */ } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailsTile.qml similarity index 100% rename from plugins/Toolbox/resources/qml/ToolboxDetailTile.qml rename to plugins/Toolbox/resources/qml/ToolboxDetailsTile.qml diff --git a/plugins/Toolbox/resources/qml/ToolboxGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml similarity index 95% rename from plugins/Toolbox/resources/qml/ToolboxGrid.qml rename to plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index 115638bd71..b05963ecd1 100644 --- a/plugins/Toolbox/resources/qml/ToolboxGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -35,7 +35,7 @@ Column Repeater { model: manager.packagesModel - delegate: ToolboxGridTile + delegate: ToolboxDownloadsGridTile { Layout.preferredWidth: (grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns } diff --git a/plugins/Toolbox/resources/qml/ToolboxGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml similarity index 94% rename from plugins/Toolbox/resources/qml/ToolboxGridTile.qml rename to plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 67c04a4cc7..a41866fc83 100644 --- a/plugins/Toolbox/resources/qml/ToolboxGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -61,6 +61,9 @@ Item MouseArea { anchors.fill: parent - onClicked: manager.detailView = true + onClicked: { + console.log(model.id) + manager.detailView = model.id + } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxViewDownloads.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml similarity index 92% rename from plugins/Toolbox/resources/qml/ToolboxViewDownloads.qml rename to plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index 4141685787..8d1cd93f13 100644 --- a/plugins/Toolbox/resources/qml/ToolboxViewDownloads.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -12,7 +12,7 @@ import UM 1.1 as UM ScrollView { id: base - frameVisible: true + frameVisible: false width: parent.width height: parent.height style: UM.Theme.styles.scrollview @@ -22,7 +22,7 @@ ScrollView spacing: UM.Theme.getSize("base_unit").height padding: UM.Theme.getSize("base_unit").height * 2 height: childrenRect.height + 2 * padding - ToolboxShowcase + ToolboxDownloadsShowcase { id: showcase width: parent.width - 2 * parent.padding @@ -33,7 +33,7 @@ ScrollView width: parent.width - 2 * parent.padding height: UM.Theme.getSize("base_unit").height / 6 } - ToolboxGrid + ToolboxDownloadsGrid { id: allPlugins width: parent.width - 2 * parent.padding diff --git a/plugins/Toolbox/resources/qml/ToolboxShowcase.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml similarity index 87% rename from plugins/Toolbox/resources/qml/ToolboxShowcase.qml rename to plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml index 5abf14cecc..c9a0babc5f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxShowcase.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml @@ -32,8 +32,8 @@ Column horizontalCenter: parent.horizontalCenter } - ToolboxShowcaseTile {} - ToolboxShowcaseTile {} - ToolboxShowcaseTile {} + ToolboxDownloadsShowcaseTile {} + ToolboxDownloadsShowcaseTile {} + ToolboxDownloadsShowcaseTile {} } } diff --git a/plugins/Toolbox/resources/qml/ToolboxShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml similarity index 74% rename from plugins/Toolbox/resources/qml/ToolboxShowcaseTile.qml rename to plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 29a9054b2d..de0d85ec96 100644 --- a/plugins/Toolbox/resources/qml/ToolboxShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -8,12 +8,6 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM -/* NOTE: This file uses the UM.Theme's "base_unit" size. It's commonly agreed -that good design is consistent design, and since the UM.Theme's JSON file does -not provide a method for interiting base units across the interface, adding more -properties for severy single UI element is undesirable for both developers and -theme makers/modfiers. Thus, "base_unit" is used wherever it can be. */ - Item { width: UM.Theme.getSize("toolbox_thumbnail_large").width diff --git a/plugins/Toolbox/resources/qml/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/ToolboxHeader.qml index 106b988e9e..28d97144c2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/ToolboxHeader.qml @@ -17,21 +17,26 @@ Rectangle { color: "transparent" height: childrenRect.height - Row { + Row + { spacing: 12 height: childrenRect.height width: childrenRect.width anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - Button { + Button + { text: "Plugins" - style: ButtonStyle { - background: Rectangle { + style: ButtonStyle + { + background: Rectangle + { color: "transparent" implicitWidth: 96 implicitHeight: 48 - Rectangle { + Rectangle + { visible: manager.currentView == "plugins" color: UM.Theme.getColor("primary") anchors.bottom: parent.bottom @@ -39,12 +44,11 @@ Rectangle { height: 3 } } - label: Text { + label: Text + { text: control.text color: UM.Theme.getColor("text") - font { - pixelSize: 15 - } + font.pixelSize: 15 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } @@ -53,17 +57,22 @@ Rectangle { { manager.filterPackagesByType("plugin") manager.currentView = "plugins" + manager.detailView = "" } } - Button { + Button + { text: "Materials" - style: ButtonStyle { - background: Rectangle { + style: ButtonStyle + { + background: Rectangle + { color: "transparent" implicitWidth: 96 implicitHeight: 48 - Rectangle { + Rectangle + { visible: manager.currentView == "materials" color: UM.Theme.getColor("primary") anchors.bottom: parent.bottom @@ -71,12 +80,11 @@ Rectangle { height: 3 } } - label: Text { + label: Text + { text: control.text color: UM.Theme.getColor("text") - font { - pixelSize: 15 - } + font.pixelSize: 15 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } @@ -85,16 +93,20 @@ Rectangle { { manager.filterPackagesByType("material") manager.currentView = "materials" + manager.detailView = "" } } } - Button { + Button + { text: "Installed" anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width - style: ButtonStyle { - background: Rectangle { + style: ButtonStyle + { + background: Rectangle + { color: "transparent" implicitWidth: 96 implicitHeight: 48 @@ -106,12 +118,11 @@ Rectangle { height: 3 } } - label: Text { + label: Text + { text: control.text color: UM.Theme.getColor("text") - font { - pixelSize: 15 - } + font.pixelSize: 15 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } diff --git a/plugins/Toolbox/resources/qml/ToolboxViewInstalled.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml similarity index 95% rename from plugins/Toolbox/resources/qml/ToolboxViewInstalled.qml rename to plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 7db50f6a24..b7ec3dad2c 100644 --- a/plugins/Toolbox/resources/qml/ToolboxViewInstalled.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -28,6 +28,6 @@ ScrollView rightMargin: UM.Theme.getSize("default_margin").width } model: manager.pluginsModel - delegate: PluginEntry {} + delegate: ToolboxInstalledTile {} } } diff --git a/plugins/Toolbox/resources/qml/PluginEntry.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml similarity index 100% rename from plugins/Toolbox/resources/qml/PluginEntry.qml rename to plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml diff --git a/plugins/Toolbox/resources/qml/SectionShadow.qml b/plugins/Toolbox/resources/qml/ToolboxShadow.qml similarity index 100% rename from plugins/Toolbox/resources/qml/SectionShadow.qml rename to plugins/Toolbox/resources/qml/ToolboxShadow.qml diff --git a/plugins/Toolbox/Toolbox/CuraPackageModel.py b/plugins/Toolbox/src/CuraPackageModel.py similarity index 100% rename from plugins/Toolbox/Toolbox/CuraPackageModel.py rename to plugins/Toolbox/src/CuraPackageModel.py diff --git a/plugins/Toolbox/Toolbox/Toolbox.py b/plugins/Toolbox/src/Toolbox.py similarity index 99% rename from plugins/Toolbox/Toolbox/Toolbox.py rename to plugins/Toolbox/src/Toolbox.py index b799754cbf..410355bae7 100644 --- a/plugins/Toolbox/Toolbox/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -129,7 +129,7 @@ class Toolbox(QObject, Extension): self.requestPackageList() if not self._dialog: - self._dialog = self._createDialog("PluginBrowser.qml") + self._dialog = self._createDialog("Toolbox.qml") self._dialog.show() def requestPackageList(self): diff --git a/plugins/Toolbox/Toolbox/__init__.py b/plugins/Toolbox/src/__init__.py similarity index 100% rename from plugins/Toolbox/Toolbox/__init__.py rename to plugins/Toolbox/src/__init__.py