qmlfrontend/Page1Form.ui.qml
author Wuzzy <Wuzzy2@mail.ru>
Thu, 25 Apr 2019 23:01:05 +0200
changeset 14839 e239378a9400
parent 14298 00b56ec8b7df
child 14915 a3ad06ac390e
permissions -rw-r--r--
Prevent entering “/”, “\” and “:” in team and scheme names. The name of teams and schems is saved in the file name itself, so these characters would cause trouble as they are used in path names in Linux and Windows.

import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3

import Hedgewars.Engine 1.0

Item {
  property alias button1: button1
  property alias previewImage: previewImage
  property alias gameButton: gameButton
  width: 1024
  height: 800
  property alias tickButton: tickButton
  property alias gameView: gameView

  ColumnLayout {
    anchors.fill: parent

    RowLayout {
      Layout.alignment: Qt.AlignHCenter

      Button {
        id: button1
        text: qsTr("Preview")
      }

      Button {
        id: gameButton
        text: qsTr("Game")
      }

      Button {
        id: tickButton
        text: qsTr("Tick")
      }
    }

    Rectangle {
      border.color: "orange"
      border.width: 5
      radius: 5

      Layout.minimumHeight: 256
      Layout.fillWidth: true

      gradient: Gradient {
        GradientStop {
          position: 0
          color: "lightblue"
        }
        GradientStop {
          position: 0.9
          color: "blue"
        }
        GradientStop {
          position: 0.9
          color: "darkblue"
        }
        GradientStop {
          position: 1.0
          color: "darkblue"
        }
      }

      Image {
        id: previewImage

        anchors.fill: parent
        anchors.margins: parent.radius
        source: "qrc:/res/iconTime.png"
        fillMode: Image.PreserveAspectFit
        cache: false
      }
    }

    GameView {
      id: gameView

      Layout.fillWidth: true
      Layout.fillHeight: true
    }
  }
}