feat: add optional label artwork mode

This commit is contained in:
2026-05-30 11:08:56 +00:00
parent d62c81762b
commit b88c2ba3c5
4 changed files with 95 additions and 43 deletions
+37 -27
View File
@@ -16,6 +16,7 @@ KCM.SimpleKCM {
property string cfg_labelVisibilityMode
property string cfg_labelPlacement
property alias cfg_labelText: labelTextArea.text
property alias cfg_useLabelArtwork: useLabelArtworkCheckBox.checked
property string cfg_backgroundStyle
property alias cfg_backgroundColor: backgroundColorField.text
property alias cfg_backgroundRadius: backgroundRadiusSpinBox.value
@@ -67,33 +68,6 @@ KCM.SimpleKCM {
return options[resolvedIndex].value;
}
component SectionHeader: Item {
required property string title
Kirigami.FormData.isSection: true
implicitHeight: sectionLayout.implicitHeight
ColumnLayout {
id: sectionLayout
anchors.left: parent.left
anchors.right: parent.right
spacing: Kirigami.Units.smallSpacing
QQC2.Label {
text: parent.parent.title
font.bold: true
}
Rectangle {
Layout.fillWidth: true
implicitHeight: 1
color: Kirigami.Theme.textColor
opacity: 0.25
}
}
}
onCfg_fontFamilyChanged: {
const index = availableFonts.indexOf(cfg_fontFamily);
if (index >= 0 && fontFamilyComboBox.currentIndex !== index)
@@ -239,6 +213,13 @@ KCM.SimpleKCM {
onActivated: configRoot.cfg_labelPlacement = currentValue
}
QQC2.CheckBox {
id: useLabelArtworkCheckBox
Kirigami.FormData.label: i18n("Label image:")
text: i18n("Show track image when available")
}
QQC2.TextArea {
id: labelTextArea
@@ -327,4 +308,33 @@ KCM.SimpleKCM {
onAccepted: configRoot.cfg_foregroundColor = selectedColor.toString()
}
component SectionHeader: Item {
required property string title
Kirigami.FormData.isSection: true
implicitHeight: sectionLayout.implicitHeight
ColumnLayout {
id: sectionLayout
anchors.left: parent.left
anchors.right: parent.right
spacing: Kirigami.Units.smallSpacing
QQC2.Label {
text: parent.parent.title
font.bold: true
}
Rectangle {
Layout.fillWidth: true
implicitHeight: 1
color: Kirigami.Theme.textColor
opacity: 0.25
}
}
}
}