mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Bar: MediaMini player (Play/Pause + title)
This commit is contained in:
+2
-6
@@ -52,13 +52,9 @@ Variants {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.marginSmall * scaling
|
||||
|
||||
// Debug show monitor name
|
||||
// NText {
|
||||
// text: screen.name
|
||||
// anchors.verticalCenter: parent.verticalCenter
|
||||
// font.weight: Style.fontWeightBold
|
||||
// }
|
||||
SystemMonitor {}
|
||||
|
||||
MediaMini {}
|
||||
}
|
||||
|
||||
// Center
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
width: visible ? mediaRow.width : 0
|
||||
height: Style.barHeight * scaling
|
||||
visible: Settings.data.bar.showMedia && (MediaPlayer.canPlay || MediaPlayer.canPause)
|
||||
|
||||
RowLayout {
|
||||
id: mediaRow
|
||||
height: parent.height
|
||||
spacing: Style.spacingTiniest * scaling
|
||||
|
||||
NIconButton {
|
||||
icon: MediaPlayer.isPlaying ? "pause" : "play_arrow"
|
||||
tooltipText: "Play/pause media"
|
||||
sizeMultiplier: 0.8
|
||||
showBorder: false
|
||||
onClicked: MediaPlayer.playPause()
|
||||
}
|
||||
|
||||
// Track info
|
||||
NText {
|
||||
text: MediaPlayer.trackTitle + " - " + MediaPlayer.trackArtist
|
||||
color: Colors.mOnSurface
|
||||
font.pointSize: Style.fontSizeSmall * scaling
|
||||
elide: Text.ElideRight
|
||||
Layout.maximumWidth: 200 * scaling
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ NBox {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginTiny * scaling
|
||||
imagePath: MediaPlayer.trackArtUrl
|
||||
fallbackIcon: "image"
|
||||
fallbackIcon: "music_note"
|
||||
borderColor: Colors.mOutline
|
||||
borderWidth: Math.max(1, Style.borderThin * scaling)
|
||||
imageRadius: width * 0.5
|
||||
|
||||
Reference in New Issue
Block a user