WIP cava process
This commit is contained in:
@@ -3,13 +3,20 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import "../constants"
|
||||
|
||||
import "../services"
|
||||
Row {
|
||||
id: root
|
||||
|
||||
property string artist: ""
|
||||
property string title: ""
|
||||
property string artUrl: ""
|
||||
property int maxTextLength: 50
|
||||
|
||||
// if the artist - title text is too long, truncate it
|
||||
readonly property string displayText: {
|
||||
const fullText = artist !== "" ? (artist + " - " + title) : title
|
||||
return fullText.length > maxTextLength ? fullText.substring(0, maxTextLength - 3) + "..." : fullText
|
||||
}
|
||||
|
||||
visible: title !== ""
|
||||
spacing: 6
|
||||
@@ -26,6 +33,14 @@ Row {
|
||||
// anchors.fill: parent
|
||||
}
|
||||
|
||||
CavaService {
|
||||
id: cavaService
|
||||
onCavaDataChanged: {
|
||||
// TODO update the canvas with the new data
|
||||
// console.log("Cava data changed: " + data)
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
width: 18
|
||||
height: 18
|
||||
@@ -35,11 +50,10 @@ Row {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: root.artist !== "" ? (root.artist + " - " + root.title) : root.title
|
||||
text: root.displayText
|
||||
color: Colors.md3.primary
|
||||
font.family: Constants.fontFamily
|
||||
font.pixelSize: Constants.fontSize
|
||||
elide: Text.ElideRight
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user