From 2fca74c690e0ad206c44636dcc9415e932b6c6af Mon Sep 17 00:00:00 2001 From: Poleric Date: Fri, 5 Jun 2026 17:29:34 +0800 Subject: [PATCH] feat: show last selected round --- src/inventory_wars/gui/InventoryWars/IdleView.qml | 14 +++++++++++++- src/inventory_wars/gui/InventoryWars/Main.qml | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/inventory_wars/gui/InventoryWars/IdleView.qml b/src/inventory_wars/gui/InventoryWars/IdleView.qml index fcb2346..f847a3e 100644 --- a/src/inventory_wars/gui/InventoryWars/IdleView.qml +++ b/src/inventory_wars/gui/InventoryWars/IdleView.qml @@ -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() } } diff --git a/src/inventory_wars/gui/InventoryWars/Main.qml b/src/inventory_wars/gui/InventoryWars/Main.qml index d30ed44..0d9c243 100644 --- a/src/inventory_wars/gui/InventoryWars/Main.qml +++ b/src/inventory_wars/gui/InventoryWars/Main.qml @@ -61,7 +61,6 @@ ApplicationWindow { leaderboard: leaderboard rounds: rounds - selectedRound: rounds.get(0) onRoundSelected: { idleView.visible = false ongoingView.start()