diff --git a/plugins/Marketplace/resources/qml/ManagePackagesButton.qml b/plugins/Marketplace/resources/qml/ManagePackagesButton.qml new file mode 100644 index 0000000000..e6c1406858 --- /dev/null +++ b/plugins/Marketplace/resources/qml/ManagePackagesButton.qml @@ -0,0 +1,44 @@ +// Copyright (c) 2021 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import UM 1.2 as UM +import Cura 1.6 as Cura + +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Button +{ + id: root + width: childrenRect.width + height: childrenRect.height + + hoverEnabled: true + + background: Rectangle + { + color: UM.Theme.getColor("action_button") + border.color: "transparent" + border.width: UM.Theme.getSize("default_lining").width + } + + Cura.ToolTip + { + id: tooltip + + tooltipText: catalog.i18nc("@info:tooltip", "Manage packages") + arrowSize: 0 + visible: root.hovered + } + + UM.RecolorImage + { + id: icon + + width: UM.Theme.getSize("section_icon").width + height: UM.Theme.getSize("section_icon").height + + color: UM.Theme.getColor("icon") + source: UM.Theme.getIcon("Settings") + } +} diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index 7004b69d46..bbe5b2b9e9 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -75,45 +75,13 @@ Window Layout.preferredWidth: parent.width Layout.preferredHeight: childrenRect.height - Button + ManagePackagesButton { id: managePackagesButton - hoverEnabled: true - - width: childrenRect.width - height: childrenRect.height - anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width - background: Rectangle - { - color: UM.Theme.getColor("action_button") - border.color: "transparent" - border.width: UM.Theme.getSize("default_lining").width - } - - Cura.ToolTip - { - id: managePackagesTooltip - - tooltipText: catalog.i18nc("@info:tooltip", "Manage packages") - arrowSize: 0 - visible: managePackagesButton.hovered - } - - UM.RecolorImage - { - id: managePackagesIcon - - width: UM.Theme.getSize("section_icon").width - height: UM.Theme.getSize("section_icon").height - - color: UM.Theme.getColor("icon") - source: UM.Theme.getIcon("Settings") - } - onClicked: { content.source = "ManagedPackages.qml"