Add qml/XmbItemDelegate.qml

This commit is contained in:
milonekrone 2026-01-14 16:03:21 +01:00
parent bad6e08cee
commit 498623217f

71
qml/XmbItemDelegate.qml Normal file
View File

@ -0,0 +1,71 @@
import QtQuick
import QtQuick.Controls
Item {
id: d
property var entryObj
property bool focused: false
signal clicked()
height: 74
Rectangle {
id: card
anchors.fill: parent
radius: 16
color: focused ? "#1a3b66" : "#0d1a33"
opacity: focused ? 0.95 : 0.75
border.color: focused ? "#7fb6ff" : "transparent"
border.width: focused ? 2 : 0
Behavior on opacity { NumberAnimation { duration: 140 } }
Behavior on color { ColorAnimation { duration: 140 } }
Behavior on border.width { NumberAnimation { duration: 140 } }
GlowFocus {
anchors.fill: parent
visible: focused
}
Row {
anchors.fill: parent
anchors.margins: 14
spacing: 14
Image {
width: 46
height: 46
source: entryObj.icon
fillMode: Image.PreserveAspectFit
smooth: true
}
Column {
spacing: 2
anchors.verticalCenter: parent.verticalCenter
Text {
text: entryObj.title
color: "white"
font.pixelSize: focused ? 22 : 20
Behavior on font.pixelSize { NumberAnimation { duration: 140 } }
}
Text {
text: entryObj.subtitle ? entryObj.subtitle : ""
visible: text.length > 0
color: "#cfe3ff"
opacity: 0.75
font.pixelSize: 14
}
}
}
scale: focused ? 1.03 : 1.0
Behavior on scale { NumberAnimation { duration: 160; easing.type: Easing.OutCubic } }
}
MouseArea {
anchors.fill: parent
onClicked: d.clicked()
}
}