Making title and subtitle obey missing information colors

This commit is contained in:
Chris Cochrun 2024-09-24 15:23:33 -05:00
parent 10d1440f5d
commit 8bc07e20ca

View file

@ -250,13 +250,42 @@ ColumnLayout {
implicitWidth: libraryList.width
height: selectedLibrary == libraryType ? 50 : 0
text: title
Controls.Label {
anchors.top: parent.verticalCenter
anchors.topMargin: Kirigami.Units.gridUnit / 2
id: itemTitle
anchors.top: parent.top
anchors.topMargin: Kirigami.Units.smallSpacing
anchors.left: parent.left
anchors.leftMargin: Kirigami.Units.gridUnit * 1.7
width: parent.width - Kirigami.Units.gridUnit * 3.5
text: title
elide: Text.ElideRight
color: {
if (selectedLibrary == "song")
Kirigami.Theme.textColor;
else if (fileValidation) {
Kirigami.Theme.textColor;
}
else
"red"
}
Binding on color {
when: dragHandler.containsMouse ||
(selectionModel.hasSelection &&
selectionModel.isSelected(proxyModel.idx(index)))
value: Kirigami.Theme.highlightedTextColor
}
}
Controls.Label {
id: itemSubtitle
anchors.top: itemTitle.bottom
anchors.topMargin: Kirigami.Units.smallSpacing
anchors.left: parent.left
anchors.leftMargin: Kirigami.Units.gridUnit * 1.7
width: parent.width - Kirigami.Units.gridUnit * 3.5
font.pointSize: 9
text: {
if (libraryType == "song")
@ -267,28 +296,29 @@ ColumnLayout {
"file is missing";
}
elide: Text.ElideRight
color: {
if (selectedLibrary == "song")
Kirigami.Theme.textColor;
else if (fileValidation) {
Kirigami.Theme.textColor;
}
else
"red"
}
Binding on color {
when: dragHandler.containsMouse ||
(selectionModel.hasSelection &&
selectionModel.isSelected(proxyModel.idx(index)))
value: Kirigami.Theme.highlightedTextColor
}
}
icon.source: itemIcon
icon.width: Kirigami.Units.gridUnit
icon.height: Kirigami.Units.gridUnit
/* supportsMouseEvents: false */
/* textColor: { */
/* if (selectedLibrary == "song") */
/* Kirigami.Theme.textColor; */
/* else if (fileValidation) { */
/* Kirigami.Theme.textColor; */
/* } */
/* else */
/* "red" */
/* } */
/* Binding on textColor { */
/* when: dragHandler.containsMouse || */
/* (selectionModel.hasSelection && */
/* selectionModel.isSelected(proxyModel.idx(index))) */
/* value: Kirigami.Theme.highlightedTextColor */
/* } */
Behavior on height {
NumberAnimation {