From 39850225fc7999b61efeba62620f52eeb0100744 Mon Sep 17 00:00:00 2001 From: cybrneko Date: Fri, 14 Aug 2026 09:05:01 -0500 Subject: [PATCH] separated game card into it's own .qml --- shell/CMakeLists.txt | 1 + shell/qml/GameCard.qml | 24 ++++++++++++++++++++++++ shell/qml/Main.qml | 7 ++----- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 shell/qml/GameCard.qml diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index 0a2a75a..f1c55fb 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -20,6 +20,7 @@ qt_add_qml_module(nomad-shell QML_FILES qml/Main.qml qml/NavigationManager.qml + qml/GameCard.qml ) target_link_libraries(nomad-shell diff --git a/shell/qml/GameCard.qml b/shell/qml/GameCard.qml new file mode 100644 index 0000000..3f2febf --- /dev/null +++ b/shell/qml/GameCard.qml @@ -0,0 +1,24 @@ +import QtQuick + +Item { + id: root + + property bool highlighted: false + + width: 120 + height: 180 + + scale: highlighted ? 1.10 : 1.0 + + Behavior on scale { + NumberAnimation { + duration: 120 + easing.type: Easing.OutCubic + } + } + + Rectangle { + anchors.fill: parent + color: "white" + } +} \ No newline at end of file diff --git a/shell/qml/Main.qml b/shell/qml/Main.qml index 32a70e0..c92b218 100644 --- a/shell/qml/Main.qml +++ b/shell/qml/Main.qml @@ -222,13 +222,10 @@ QtObject { gamesList.scrollTo(gamesList.snappedContentX(gamesList.contentX)) } - delegate: Rectangle { // TODO: design a real game card QML to replace this placeholder + delegate: GameCard { id: gameTile - width: 120 - height: 180 - - color: navigationManager.currentItem === gameTile ? "blue" : "white" + highlighted: navigationManager.currentItem === gameTile function onNavigationFocused() { gamesList.currentIndex = index