separated game card into it's own .qml
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user