diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 90b92bd832..4aaea20813 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -15,7 +15,7 @@ Item { id: sidebar } - Rectangle + Item { id: header anchors diff --git a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml index 5c60e368a9..8524b7d1e5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml +++ b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml @@ -23,6 +23,7 @@ Item { id: button text: catalog.i18nc("@action:button", "Back") + enabled: !toolbox.isDownloading UM.RecolorImage { id: backArrow @@ -39,7 +40,7 @@ Item width: width height: height } - color: button.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text") + color: button.enabled ? (button.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text")) : UM.Theme.getColor("text_inactive") source: UM.Theme.getIcon("arrow_left") } width: UM.Theme.getSize("toolbox_back_button").width @@ -59,7 +60,7 @@ Item { id: labelStyle text: control.text - color: control.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text") + color: control.enabled ? (control.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text")) : UM.Theme.getColor("text_inactive") font: UM.Theme.getFont("default_bold") horizontalAlignment: Text.AlignRight width: control.width diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 270e8fc1fc..cba55051f5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -9,9 +9,8 @@ import UM 1.1 as UM Item { id: page - property var details: base.selection + property var details: base.selection || {} anchors.fill: parent - width: parent.width ToolboxBackColumn { id: sidebar diff --git a/plugins/Toolbox/resources/qml/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/ToolboxHeader.qml index 59c51039d9..f2ed8fc31f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/ToolboxHeader.qml @@ -25,7 +25,7 @@ Item { text: catalog.i18nc("@title:tab", "Plugins") active: toolbox.viewCategory == "plugin" && enabled - enabled: toolbox.viewPage != "loading" && toolbox.viewPage != "errored" + enabled: !toolbox.isDownloading && toolbox.viewPage != "loading" && toolbox.viewPage != "errored" onClicked: { toolbox.filterModelByProp("packages", "type", "plugin") @@ -39,7 +39,7 @@ Item { text: catalog.i18nc("@title:tab", "Materials") active: toolbox.viewCategory == "material" && enabled - enabled: toolbox.viewPage != "loading" && toolbox.viewPage != "errored" + enabled: !toolbox.isDownloading && toolbox.viewPage != "loading" && toolbox.viewPage != "errored" onClicked: { toolbox.filterModelByProp("authors", "package_types", "material") @@ -53,6 +53,7 @@ Item { text: catalog.i18nc("@title:tab", "Installed") active: toolbox.viewCategory == "installed" + enabled: !toolbox.isDownloading anchors { right: parent.right diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index be9fe65004..3e2085277a 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -603,7 +603,7 @@ class Toolbox(QObject, Extension): @pyqtSlot() def cancelDownload(self) -> None: - Logger.log("i", "Toolbox: User cancelled the download of a plugin.") + Logger.log("i", "Toolbox: User cancelled the download of a package.") self.resetDownload() def resetDownload(self) -> None: @@ -755,6 +755,7 @@ class Toolbox(QObject, Extension): self._active_package = package self.activePackageChanged.emit() + ## The active package is the package that is currently being downloaded @pyqtProperty(QObject, fset = setActivePackage, notify = activePackageChanged) def activePackage(self) -> Optional[Dict[str, Any]]: return self._active_package