mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:19:04 +08:00
The AccountDetails Panel is now an actual popup
This ensures that it's always visible (previously it was ocluded by the StageMenu) CURA-5772
This commit is contained in:
parent
62c9980438
commit
f6ae19003b
@ -7,62 +7,59 @@ import QtQuick.Controls 2.1
|
|||||||
import UM 1.4 as UM
|
import UM 1.4 as UM
|
||||||
import Cura 1.1 as Cura
|
import Cura 1.1 as Cura
|
||||||
|
|
||||||
Item
|
Button
|
||||||
{
|
{
|
||||||
id: accountWidget
|
id: accountWidget
|
||||||
property var profile: Cura.API.account.userProfile
|
property var profile: Cura.API.account.userProfile
|
||||||
property var loggedIn: Cura.API.account.isLoggedIn
|
property var loggedIn: Cura.API.account.isLoggedIn
|
||||||
height: UM.Theme.getSize("topheader").height
|
|
||||||
width: UM.Theme.getSize("topheader").height
|
implicitHeight: UM.Theme.getSize("topheader").height
|
||||||
|
implicitWidth: UM.Theme.getSize("topheader").height
|
||||||
|
|
||||||
|
|
||||||
AvatarImage
|
AvatarImage
|
||||||
{
|
{
|
||||||
id: avatar
|
id: avatar
|
||||||
|
|
||||||
|
|
||||||
width: Math.round(0.8 * parent.width)
|
width: Math.round(0.8 * parent.width)
|
||||||
height: Math.round(0.8 * parent.height)
|
height: Math.round(0.8 * parent.height)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
source: loggedIn ? profile["profile_image_url"] : UM.Theme.getImage("avatar_default")
|
source: loggedIn ? profile["profile_image_url"] : UM.Theme.getImage("avatar_default")
|
||||||
outlineColor: loggedIn ? UM.Theme.getColor("account_widget_ouline_active") : UM.Theme.getColor("account_widget_ouline_inactive")
|
outlineColor: loggedIn ? UM.Theme.getColor("account_widget_ouline_active") : UM.Theme.getColor("account_widget_ouline_inactive")
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea
|
background: Item {}
|
||||||
|
|
||||||
|
onClicked: popup.open()
|
||||||
|
|
||||||
|
Popup
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
id: popup
|
||||||
onClicked: accountManagementPanel.visible = !accountManagementPanel.visible // Collapse/Expand the dropdown panel
|
|
||||||
}
|
|
||||||
|
|
||||||
UM.PointingRectangle
|
y: parent.height + UM.Theme.getSize("default_arrow").height
|
||||||
{
|
x: (parent.width - width)
|
||||||
id: accountManagementPanel
|
|
||||||
|
|
||||||
width: panel.width
|
contentItem: AccountDetails
|
||||||
height: panel.height
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
// Shows the user management options or general options to create account
|
|
||||||
AccountDetails
|
|
||||||
{
|
{
|
||||||
id: panel
|
id: panel
|
||||||
profile: Cura.API.account.userProfile
|
profile: Cura.API.account.userProfile
|
||||||
loggedIn: Cura.API.account.isLoggedIn
|
loggedIn: Cura.API.account.isLoggedIn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
background: UM.PointingRectangle
|
||||||
|
{
|
||||||
|
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
|
||||||
|
|
||||||
|
target: Qt.point(width - (accountWidget.width / 2), -10)
|
||||||
|
|
||||||
|
arrowSize: UM.Theme.getSize("default_arrow").width
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user