Compare commits
No commits in common. "b5b2276ff11972c0cf2a81d8f1a3c2614e3f690a" and "28fb0e4d00e5c939b96e7d1ee4f1f2647aa17894" have entirely different histories.
b5b2276ff1
...
28fb0e4d00
4 changed files with 13 additions and 60 deletions
|
|
@ -20,8 +20,7 @@ QtObject {
|
||||||
enable: true
|
enable: true
|
||||||
})
|
})
|
||||||
property var notifications: ({
|
property var notifications: ({
|
||||||
enable: true,
|
enable: true
|
||||||
timeout: 3000
|
|
||||||
})
|
})
|
||||||
property var mpris: ({
|
property var mpris: ({
|
||||||
enable: true
|
enable: true
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,8 @@ M.BarSection {
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
tooltip: ""
|
tooltip: ""
|
||||||
|
|
||||||
property int _playerIdx: 0
|
readonly property MprisPlayer player: Mpris.players.values[0] ?? null
|
||||||
readonly property var _players: Mpris.players.values ?? []
|
|
||||||
readonly property MprisPlayer player: _players[_playerIdx] ?? _players[0] ?? null
|
|
||||||
readonly property bool playing: player?.playbackState === MprisPlaybackState.Playing
|
readonly property bool playing: player?.playbackState === MprisPlaybackState.Playing
|
||||||
|
|
||||||
// Reset index if current player disappears
|
|
||||||
on_PlayersChanged: if (_playerIdx >= _players.length)
|
|
||||||
_playerIdx = 0
|
|
||||||
property string _cachedArt: ""
|
property string _cachedArt: ""
|
||||||
property string _artTrack: ""
|
property string _artTrack: ""
|
||||||
|
|
||||||
|
|
@ -434,48 +428,15 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player switcher
|
// Player name
|
||||||
Row {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
height: 22
|
|
||||||
spacing: 6
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: root._players
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
required property var modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
readonly property bool _active: index === root._playerIdx
|
|
||||||
|
|
||||||
width: _pLabel.implicitWidth + 12
|
|
||||||
height: 18
|
|
||||||
radius: 9
|
|
||||||
color: _active ? M.Theme.base02 : (pArea.containsMouse ? M.Theme.base02 : "transparent")
|
|
||||||
border.color: _active ? M.Theme.base0E : M.Theme.base03
|
|
||||||
border.width: _active ? 1 : 0
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: _pLabel
|
width: parent.width
|
||||||
anchors.centerIn: parent
|
height: 20
|
||||||
text: modelData.identity ?? "Player"
|
horizontalAlignment: Text.AlignHCenter
|
||||||
color: _active ? M.Theme.base0E : M.Theme.base04
|
text: root.player?.identity ?? ""
|
||||||
|
color: M.Theme.base03
|
||||||
font.pixelSize: M.Theme.fontSize - 2
|
font.pixelSize: M.Theme.fontSize - 2
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
font.bold: _active
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: pArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: root._playerIdx = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Services.Notifications
|
import Quickshell.Services.Notifications
|
||||||
import "." as M
|
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -85,7 +84,7 @@ QtObject {
|
||||||
|
|
||||||
// Auto-expire popup
|
// Auto-expire popup
|
||||||
if (data.popup) {
|
if (data.popup) {
|
||||||
const timeout = notif.expireTimeout > 0 ? notif.expireTimeout : (M.Modules.notifications.timeout || 3000);
|
const timeout = notif.expireTimeout > 0 ? notif.expireTimeout : 5000;
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
_expireTimer.createObject(root, {
|
_expireTimer.createObject(root, {
|
||||||
_notifId: data.id,
|
_notifId: data.id,
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ in
|
||||||
"tray"
|
"tray"
|
||||||
"windowTitle"
|
"windowTitle"
|
||||||
"clock"
|
"clock"
|
||||||
|
"notifications"
|
||||||
"mpris"
|
"mpris"
|
||||||
"volume"
|
"volume"
|
||||||
"idleInhibitor"
|
"idleInhibitor"
|
||||||
|
|
@ -90,13 +91,6 @@ in
|
||||||
in
|
in
|
||||||
simpleModules
|
simpleModules
|
||||||
// {
|
// {
|
||||||
notifications = moduleOpt "notifications" {
|
|
||||||
timeout = lib.mkOption {
|
|
||||||
type = lib.types.int;
|
|
||||||
default = 3000;
|
|
||||||
description = "Notification popup timeout in milliseconds.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bluetooth = moduleOpt "bluetooth" (intervalOpt 5000);
|
bluetooth = moduleOpt "bluetooth" (intervalOpt 5000);
|
||||||
network = moduleOpt "network" (intervalOpt 5000);
|
network = moduleOpt "network" (intervalOpt 5000);
|
||||||
powerProfile = moduleOpt "powerProfile" (intervalOpt 5000);
|
powerProfile = moduleOpt "powerProfile" (intervalOpt 5000);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue