feat: show last selected round
This commit is contained in:
@@ -15,7 +15,8 @@ Rectangle {
|
||||
|
||||
required property SqlLeaderboardModel leaderboard
|
||||
required property ListModel rounds
|
||||
property QtObject selectedRound
|
||||
property QtObject selectedRound: rounds.get(0)
|
||||
property bool selected: false
|
||||
|
||||
signal roundSelected()
|
||||
|
||||
@@ -52,6 +53,16 @@ Rectangle {
|
||||
textRole: "name"
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
font.pixelSize: UIStyle.fontSizeM
|
||||
color: UIStyle.textColor
|
||||
visible: root.selected
|
||||
|
||||
text: "Last selected: " + selectedRound.name
|
||||
}
|
||||
|
||||
Button {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
@@ -63,6 +74,7 @@ Rectangle {
|
||||
|
||||
onClicked: {
|
||||
root.selectedRound = rounds.get(roundSelect.currentIndex)
|
||||
root.selected = true
|
||||
roundSelected()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ ApplicationWindow {
|
||||
|
||||
leaderboard: leaderboard
|
||||
rounds: rounds
|
||||
selectedRound: rounds.get(0)
|
||||
onRoundSelected: {
|
||||
idleView.visible = false
|
||||
ongoingView.start()
|
||||
|
||||
Reference in New Issue
Block a user