Files
Jellyfin-Freebox/Components/ServerItem.qml
T

72 lines
1.7 KiB
QML

import QtQuick 2.5
import "../Shared"
// Ligne de la liste des serveurs.
Rectangle {
id: root
property string name: ""
property string address: ""
property bool highlighted: false
signal clicked()
height: 72
radius: Theme.radius
color: highlighted ? Theme.focusBackground : Theme.surface
Behavior on color { ColorAnimation { duration: Theme.animFast } }
Rectangle {
id: icon
anchors {
left: parent.left
leftMargin: Theme.spacingM
verticalCenter: parent.verticalCenter
}
width: 40
height: 40
radius: width / 2
color: Theme.avatarColor(root.name)
Text {
anchors.centerIn: parent
text: root.name.charAt(0).toUpperCase()
color: Theme.text
font.pixelSize: Theme.fontBody
font.bold: true
}
}
Column {
anchors {
left: icon.right
leftMargin: Theme.spacingM
right: parent.right
rightMargin: Theme.spacingM
verticalCenter: parent.verticalCenter
}
Text {
width: parent.width
text: root.name
color: root.highlighted ? Theme.textOnFocus : Theme.text
font.pixelSize: Theme.fontBody
font.bold: true
elide: Text.ElideRight
}
Text {
width: parent.width
text: root.address
color: root.highlighted ? Theme.textOnFocusMuted : Theme.textMuted
font.pixelSize: Theme.fontSmall
elide: Text.ElideRight
}
}
MouseArea {
anchors.fill: parent
onClicked: root.clicked()
}
}