diff --git a/resources/qml/Skeleton/ApplicationViews.qml b/resources/qml/Skeleton/ApplicationViews.qml index 8e0b6efc0b..25c2ff9983 100644 --- a/resources/qml/Skeleton/ApplicationViews.qml +++ b/resources/qml/Skeleton/ApplicationViews.qml @@ -9,6 +9,8 @@ import QtQuick.Layouts 1.1 import UM 1.4 as UM import Cura 1.0 as Cura +import "components" + // This item contains the views selector, a combobox that is dinamically created from // the list of available Views (packages that create different visualizactions of the // scene. Aside the selector, there is a row of buttons that change the orientation of the view. diff --git a/resources/qml/Skeleton/TopHeader.qml b/resources/qml/Skeleton/TopHeader.qml index bf92fbb41d..c2e03aa04b 100644 --- a/resources/qml/Skeleton/TopHeader.qml +++ b/resources/qml/Skeleton/TopHeader.qml @@ -4,11 +4,12 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 -import QtQuick.Layouts 1.1 import UM 1.4 as UM import Cura 1.0 as Cura +import "components" + Rectangle { id: base @@ -75,10 +76,20 @@ Rectangle text: catalog.i18nc("@action:button", "Toolbox") anchors { - right: parent.right - leftMargin: UM.Theme.getSize("default_margin").width + right: accountWidget.left + rightMargin: UM.Theme.getSize("default_margin").width } style: UM.Theme.styles.topheader_tab action: Cura.Actions.browsePackages } + + AccountWidget + { + id: accountWidget + anchors + { + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + } + } } diff --git a/resources/qml/Skeleton/components/AccountWidget.qml b/resources/qml/Skeleton/components/AccountWidget.qml new file mode 100644 index 0000000000..3d33aeaf27 --- /dev/null +++ b/resources/qml/Skeleton/components/AccountWidget.qml @@ -0,0 +1,71 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 1.1 + +import UM 1.4 as UM + +Item +{ + id: base + height: UM.Theme.getSize("topheader").height + width: UM.Theme.getSize("topheader").height + + AvatarImage + { + id: avatar + width: Math.round(0.8 * parent.width) + height: Math.round(0.8 * parent.height) + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + } + + MouseArea + { + anchors.fill: avatar + onClicked: + { + // Collapse/Expand the dropdown panel + accountManagementPanel.visible = !accountManagementPanel.visible + } + } + + UM.PointingRectangle + { + id: accountManagementPanel + + width: 250 + height: 250 + + anchors + { + top: parent.bottom + topMargin: UM.Theme.getSize("default_margin").height + right: parent.right + } + + target: Qt.point(parent.width / 2, parent.bottom) + arrowSize: UM.Theme.getSize("default_arrow").width + + visible: false + opacity: visible ? 1 : 0 + Behavior on opacity { NumberAnimation { duration: 100 } } + + color: UM.Theme.getColor("tool_panel_background") + borderColor: UM.Theme.getColor("lining") + borderWidth: UM.Theme.getSize("default_lining").width + + Loader + { + id: panel + sourceComponent: login + } + } + + Component + { + id: login + Label {text: "HOLA"} + } +} \ No newline at end of file diff --git a/resources/qml/Skeleton/components/AvatarImage.qml b/resources/qml/Skeleton/components/AvatarImage.qml new file mode 100644 index 0000000000..52e2757cbf --- /dev/null +++ b/resources/qml/Skeleton/components/AvatarImage.qml @@ -0,0 +1,42 @@ +// Copyright (c) 2018 Ultimaker B.V. +import QtQuick 2.7 +import QtQuick.Controls 2.1 +import QtGraphicalEffects 1.0 + +import UM 1.4 as UM + +Item +{ + id: avatar + + Image + { + id: profileImage + source: UM.Theme.getImage("avatar_default") + sourceSize: Qt.size(parent.width, parent.height) + width: parent.width + height: parent.height + fillMode: Image.PreserveAspectCrop + visible: false + } + + UM.RecolorImage + { + id: profileImageMask + source: UM.Theme.getIcon("circle_mask") + sourceSize: Qt.size(parent.width, parent.height) + width: parent.width + height: parent.height + color: UM.Theme.getColor("topheader_background") + visible: false + } + + OpacityMask + { + anchors.fill: profileImage + source: profileImage + maskSource: profileImageMask + cached: true + invert: false + } +} \ No newline at end of file diff --git a/resources/qml/Skeleton/OrientationViews.qml b/resources/qml/Skeleton/components/OrientationViews.qml similarity index 100% rename from resources/qml/Skeleton/OrientationViews.qml rename to resources/qml/Skeleton/components/OrientationViews.qml diff --git a/resources/themes/cura-light/icons/circle_mask.svg b/resources/themes/cura-light/icons/circle_mask.svg new file mode 100644 index 0000000000..d5bfe53a97 --- /dev/null +++ b/resources/themes/cura-light/icons/circle_mask.svg @@ -0,0 +1,64 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/resources/themes/cura-light/images/avatar_default.png b/resources/themes/cura-light/images/avatar_default.png new file mode 100644 index 0000000000..0c306680f7 Binary files /dev/null and b/resources/themes/cura-light/images/avatar_default.png differ