UserOperations.qml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import UM 1.4 as UM
  6. import Cura 1.1 as Cura
  7. Column
  8. {
  9. width: Math.max(title.width,
  10. accountButton.width) * 1.5
  11. spacing: UM.Theme.getSize("default_margin").width
  12. Label
  13. {
  14. id: title
  15. anchors.horizontalCenter: parent.horizontalCenter
  16. horizontalAlignment: Text.AlignHCenter
  17. renderType: Text.NativeRendering
  18. text: catalog.i18nc("@label", "Hi " + profile.username)
  19. font: UM.Theme.getFont("large_bold")
  20. color: UM.Theme.getColor("text")
  21. }
  22. // placeholder
  23. Label
  24. {
  25. text: " "
  26. }
  27. Cura.SecondaryButton
  28. {
  29. id: accountButton
  30. anchors.horizontalCenter: parent.horizontalCenter
  31. width: UM.Theme.getSize("account_button").width
  32. height: UM.Theme.getSize("account_button").height
  33. text: catalog.i18nc("@button", "Ultimaker account")
  34. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl)
  35. fixedWidthMode: false
  36. }
  37. Label
  38. {
  39. id: signOutButton
  40. anchors.horizontalCenter: parent.horizontalCenter
  41. text: catalog.i18nc("@button", "Sign out")
  42. color: UM.Theme.getColor("secondary_button_text")
  43. font: UM.Theme.getFont("medium")
  44. renderType: Text.NativeRendering
  45. MouseArea
  46. {
  47. anchors.fill: parent
  48. onClicked: Cura.API.account.logout()
  49. hoverEnabled: true
  50. onEntered: signOutButton.font.underline = true
  51. onExited: signOutButton.font.underline = false
  52. }
  53. }
  54. }