AccountWidget.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import UM 1.4 as UM
  6. Item
  7. {
  8. id: base
  9. height: UM.Theme.getSize("topheader").height
  10. width: UM.Theme.getSize("topheader").height
  11. AvatarImage
  12. {
  13. id: avatar
  14. width: Math.round(0.8 * parent.width)
  15. height: Math.round(0.8 * parent.height)
  16. anchors.verticalCenter: parent.verticalCenter
  17. anchors.horizontalCenter: parent.horizontalCenter
  18. }
  19. MouseArea
  20. {
  21. anchors.fill: avatar
  22. onClicked:
  23. {
  24. // Collapse/Expand the dropdown panel
  25. accountManagementPanel.visible = !accountManagementPanel.visible
  26. }
  27. }
  28. UM.PointingRectangle
  29. {
  30. id: accountManagementPanel
  31. width: 250
  32. height: 250
  33. anchors
  34. {
  35. top: parent.bottom
  36. topMargin: UM.Theme.getSize("default_margin").height
  37. right: parent.right
  38. }
  39. target: Qt.point(parent.width / 2, parent.bottom)
  40. arrowSize: UM.Theme.getSize("default_arrow").width
  41. visible: false
  42. opacity: visible ? 1 : 0
  43. Behavior on opacity { NumberAnimation { duration: 100 } }
  44. color: UM.Theme.getColor("tool_panel_background")
  45. borderColor: UM.Theme.getColor("lining")
  46. borderWidth: UM.Theme.getSize("default_lining").width
  47. Loader
  48. {
  49. id: panel
  50. sourceComponent: login
  51. }
  52. }
  53. Component
  54. {
  55. id: login
  56. Label {text: "HOLA"}
  57. }
  58. }