Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/music/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
<entry name="lyricsFontSizeTall" type="Int">
<default>55</default>
</entry>
<entry name="lyricsNotFoundMessage" type="String">
<default></default>
</entry>
<entry name="artRefreshEnabled" type="Bool">
<default>false</default>
</entry>
Expand Down
20 changes: 20 additions & 0 deletions packages/music/contents/ui/config/ConfigLyrics.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ColumnLayout {
property alias cfg_lyricsFontSizeTall: tallFontSpin.value
property alias cfg_lyricsBlur: lyricsBlurCheck.checked
property alias cfg_artRefreshEnabled: artRefreshCheck.checked
property alias cfg_lyricsNotFoundMessage: notFoundField.text

Kirigami.FormLayout {
Layout.fillWidth: true
Expand Down Expand Up @@ -68,5 +69,24 @@ ColumnLayout {
text: i18n("Briefly pause/resume to refresh album art (causes playback hiccups)")
}

Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Not found message")
}

TextField {
id: notFoundField
Kirigami.FormData.label: i18n("No-lyrics message:")
placeholderText: i18n("Leave empty for default \u201cNo lyrics available\u201d")
Layout.fillWidth: true
}

Label {
Layout.fillWidth: true
text: i18n("Custom text shown when lyrics cannot be found for the current track.")
wrapMode: Text.WordWrap
opacity: 0.7
}

}
}
2 changes: 2 additions & 0 deletions packages/music/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ PlasmoidItem {
lyricsActiveOpacity: plasmoid.configuration.lyricsActiveOpacity / 100
lyricsInactiveOpacity: plasmoid.configuration.lyricsInactiveOpacity / 100
lyricsFontSizeFactor: plasmoid.configuration.lyricsFontSizeTall / 1000
lyricsNotFoundMessage: plasmoid.configuration.lyricsNotFoundMessage
fontFamily: sfRegular.name
fontFamilyThin: sfThin.name
track: root.track
Expand Down Expand Up @@ -622,6 +623,7 @@ PlasmoidItem {
lyricsActiveOpacity: plasmoid.configuration.lyricsActiveOpacity / 100
lyricsInactiveOpacity: plasmoid.configuration.lyricsInactiveOpacity / 100
lyricsFontSizeFactor: plasmoid.configuration.lyricsFontSizeWide / 1000
lyricsNotFoundMessage: plasmoid.configuration.lyricsNotFoundMessage
fontFamily: sfRegular.name
fontFamilyThin: sfThin.name
track: root.track
Expand Down
6 changes: 5 additions & 1 deletion packages/music/contents/ui/widget/SyncedLyricsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Item {
property bool blurEnabled: true
property real activeOpacity: 1.0
property real inactiveOpacity: 0.40
property string notFoundMessage: ""
readonly property real activeScale: 1.05

signal seekTo(real positionUs)
Expand Down Expand Up @@ -231,14 +232,17 @@ Item {

// ── Not found ─────────────────────────────────────────────────────────
Text {
id: notFoundLabel
anchors.centerIn: parent
visible: lv.lyricsState === 4 || (lv.lyricsState === 2 && lv.syncedLyrics.length === 0 && lv.plainLyrics === "")
text: i18n("No lyrics available")
text: lv.notFoundMessage !== "" ? lv.notFoundMessage : i18n("No lyrics available")
color: "#ffffff"
opacity: 0.45
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Math.max(12, Math.round(lv.baseFontSize * 0.8))
font.weight: Font.Medium
font.family: lv.fontFamily
wrapMode: Text.WordWrap
}

// ── Error (tap to retry) ──────────────────────────────────────────────
Expand Down
2 changes: 2 additions & 0 deletions packages/music/contents/ui/widget/TallWideLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Item {
property real lyricsActiveOpacity: 1.0
property real lyricsInactiveOpacity: 0.40
property real lyricsFontSizeFactor: 0.055
property string lyricsNotFoundMessage: ""

signal togglePlaying()
signal nextTrack()
Expand Down Expand Up @@ -161,6 +162,7 @@ Item {
blurEnabled: layout.lyricsBlur
activeOpacity: layout.lyricsActiveOpacity
inactiveOpacity: layout.lyricsInactiveOpacity
notFoundMessage: layout.lyricsNotFoundMessage
onSeekTo: function(posUs) { layout.seek(posUs) }
onRetryLyrics: layout.retryLyrics()
}
Expand Down
2 changes: 2 additions & 0 deletions packages/music/contents/ui/widget/WideLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Item {
property real lyricsActiveOpacity: 1.0
property real lyricsInactiveOpacity: 0.40
property real lyricsFontSizeFactor: 0.077
property string lyricsNotFoundMessage: ""

signal togglePlaying()
signal nextTrack()
Expand Down Expand Up @@ -206,6 +207,7 @@ Item {
blurEnabled: layout.lyricsBlur
activeOpacity: layout.lyricsActiveOpacity
inactiveOpacity: layout.lyricsInactiveOpacity
notFoundMessage: layout.lyricsNotFoundMessage
onSeekTo: function(posUs) { layout.seek(posUs) }
onRetryLyrics: layout.retryLyrics()
}
Expand Down