summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-02 17:00:07 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-02 17:00:07 +1000
commitc2b2627b88390e74562fa8fc72594c301a62751c (patch)
tree8b2b93423bb73f79159b4a7b21514fca0b9f19ec /modules
parentosd: animate scrolling (#316) (diff)
downloadcaelestia-shell-c2b2627b88390e74562fa8fc72594c301a62751c.tar.gz
caelestia-shell-c2b2627b88390e74562fa8fc72594c301a62751c.tar.bz2
caelestia-shell-c2b2627b88390e74562fa8fc72594c301a62751c.zip
dashboard: better no media
Closes #323
Diffstat (limited to 'modules')
-rw-r--r--modules/dashboard/Media.qml55
1 files changed, 26 insertions, 29 deletions
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index be31236..95e412b 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -157,27 +157,45 @@ Item {
spacing: Appearance.spacing.small
- ElideText {
+ StyledText {
id: title
- label: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
- color: Colours.palette.m3primary
+ Layout.fillWidth: true
+ Layout.maximumWidth: parent.implicitWidth
+
+ animate: true
+ horizontalAlignment: Text.AlignHCenter
+ text: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
+ color: Players.active ? Colours.palette.m3primary : Colours.palette.m3onSurface
font.pointSize: Appearance.font.size.normal
}
- ElideText {
+ StyledText {
id: album
- label: (Players.active?.trackAlbum ?? qsTr("No media")) || qsTr("Unknown album")
+ Layout.fillWidth: true
+ Layout.maximumWidth: parent.implicitWidth
+
+ animate: true
+ horizontalAlignment: Text.AlignHCenter
+ visible: !!Players.active
+ text: Players.active?.trackAlbum || qsTr("Unknown album")
color: Colours.palette.m3outline
font.pointSize: Appearance.font.size.small
}
- ElideText {
+ StyledText {
id: artist
- label: (Players.active?.trackArtist ?? qsTr("No media")) || qsTr("Unknown artist")
- color: Colours.palette.m3secondary
+ Layout.fillWidth: true
+ Layout.maximumWidth: parent.implicitWidth
+
+ animate: true
+ horizontalAlignment: Text.AlignHCenter
+ text: (Players.active?.trackArtist ?? qsTr("Play some music for stuff to show up here!")) || qsTr("Unknown artist")
+ color: Players.active ? Colours.palette.m3secondary : Colours.palette.m3outline
+ elide: Text.ElideRight
+ wrapMode: Players.active ? Text.NoWrap : Text.WordWrap
}
RowLayout {
@@ -572,27 +590,6 @@ Item {
}
}
- component ElideText: StyledText {
- id: elideText
-
- property alias label: metrics.text
-
- Layout.fillWidth: true
-
- animate: true
- horizontalAlignment: Text.AlignHCenter
- text: metrics.elidedText
-
- TextMetrics {
- id: metrics
-
- font.family: elideText.font.family
- font.pointSize: elideText.font.pointSize
- elide: Text.ElideRight
- elideWidth: elideText.width
- }
- }
-
component PlayerControl: StyledRect {
id: control