RegisterWindow < MainWindow
  id: registerWindow
  size: 360 330
  title: tr('NewTibia Cloud - Create Account')
  anchors.centerIn: parent
  draggable: true
  @onEnter: EnterGame.doRegister()
  @onEscape: EnterGame.closeRegisterWindow()

  Panel
    anchors.fill: parent
    margin: 8

    Label
      !text: tr('Create a new NewTibia Cloud account')
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: parent.top
      text-auto-resize: true
      margin-bottom: 8
      color: #bbbbbb

    Label
      !text: tr('Account name')
      anchors.left: parent.left
      anchors.top: prev.bottom
      margin-top: 10
      text-auto-resize: true

    TextEdit
      id: registerAccountTextEdit
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 2

    Label
      !text: tr('Password (min 4 chars)')
      anchors.left: parent.left
      anchors.top: prev.bottom
      margin-top: 8
      text-auto-resize: true

    PasswordTextEdit
      id: registerPasswordTextEdit
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 2

    Label
      !text: tr('Email (optional)')
      anchors.left: parent.left
      anchors.top: prev.bottom
      margin-top: 8
      text-auto-resize: true

    TextEdit
      id: registerEmailTextEdit
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 2

    Label
      id: registerStatusLabel
      !text: ''
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 8
      text-auto-resize: true
      color: white

    HorizontalSeparator
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 8

    Panel
      id: registerButtonsPanel
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 8
      height: 26
      layout: horizontalBox
      spacing: 6

      Button
        !text: tr('Accept and create account')
        width: 170
        height: 22
        @onClick: EnterGame.doRegister()

      Button
        !text: tr('Cancel')
        width: 100
        height: 22
        @onClick: EnterGame.closeRegisterWindow()
