UserOperations.qml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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, accountButton.width) + 2 * UM.Theme.getSize("default_margin").width
  10. spacing: UM.Theme.getSize("default_margin").height
  11. Label
  12. {
  13. id: title
  14. anchors.horizontalCenter: parent.horizontalCenter
  15. horizontalAlignment: Text.AlignHCenter
  16. renderType: Text.NativeRendering
  17. text: catalog.i18nc("@label The argument is a username.", "Hi %1").arg(profile.username)
  18. font: UM.Theme.getFont("large_bold")
  19. color: UM.Theme.getColor("text")
  20. }
  21. Cura.SecondaryButton
  22. {
  23. id: accountButton
  24. anchors.horizontalCenter: parent.horizontalCenter
  25. width: UM.Theme.getSize("account_button").width
  26. height: UM.Theme.getSize("account_button").height
  27. text: catalog.i18nc("@button", "Ultimaker account")
  28. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl)
  29. fixedWidthMode: false
  30. }
  31. Label
  32. {
  33. id: signOutButton
  34. anchors.horizontalCenter: parent.horizontalCenter
  35. text: catalog.i18nc("@button", "Sign out")
  36. color: UM.Theme.getColor("secondary_button_text")
  37. font: UM.Theme.getFont("medium")
  38. renderType: Text.NativeRendering
  39. MouseArea
  40. {
  41. anchors.fill: parent
  42. onClicked: Cura.API.account.logout()
  43. hoverEnabled: true
  44. onEntered: signOutButton.font.underline = true
  45. onExited: signOutButton.font.underline = false
  46. }
  47. }
  48. }