feat: make gui?
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
import InventoryWars
|
||||
import Style
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
color: UIStyle.background
|
||||
|
||||
required property ListModel rounds
|
||||
property QtObject selectedRound
|
||||
|
||||
signal roundSelected()
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
spacing: 20
|
||||
|
||||
Item { Layout.fillHeight: true }
|
||||
|
||||
Image {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.preferredWidth: 256
|
||||
|
||||
source: "images/modules.png"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
font.pixelSize: UIStyle.fontSizeXL
|
||||
color: UIStyle.titletextColor
|
||||
|
||||
text: "Start a round"
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: roundSelect
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
model: root.rounds
|
||||
textRole: "name"
|
||||
}
|
||||
|
||||
Button {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
buttonColor: UIStyle.highlightColor
|
||||
buttonBorderColor: UIStyle.highlightBorderColor
|
||||
textColor: UIStyle.textColor
|
||||
|
||||
text: "Start"
|
||||
|
||||
onClicked: {
|
||||
root.selectedRound = rounds.get(roundSelect.currentIndex)
|
||||
roundSelected()
|
||||
}
|
||||
}
|
||||
|
||||
TableView {
|
||||
Layout.fillHeight: true
|
||||
|
||||
columnSpacing: 1
|
||||
rowSpacing: 1
|
||||
|
||||
delegate: Rectangle {
|
||||
border.width: 1
|
||||
implicitHeight: 50
|
||||
implicitWidth: 100
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: display
|
||||
}
|
||||
}
|
||||
|
||||
model: TableModel {
|
||||
rows: [
|
||||
{
|
||||
User: "me",
|
||||
Score: "1"
|
||||
}
|
||||
]
|
||||
|
||||
TableModelColumn {
|
||||
display: "User"
|
||||
}
|
||||
|
||||
TableModelColumn {
|
||||
display: "Score"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user