mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 10:32:07 -04:00
Compare commits
2 Commits
66ce79b9bf
...
61ee5f4336
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61ee5f4336 | ||
|
|
ce2a92ec27 |
@@ -369,9 +369,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function previous(): void {
|
function previous(): void {
|
||||||
if (MprisController.activePlayer && MprisController.activePlayer.canGoPrevious) {
|
MprisController.previousOrRewind();
|
||||||
MprisController.activePlayer.previous();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function next(): void {
|
function next(): void {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ BasePill {
|
|||||||
StyledTextMetrics {
|
StyledTextMetrics {
|
||||||
id: cpuBaseline
|
id: cpuBaseline
|
||||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||||
text: "88%"
|
text: "100%"
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledTextMetrics {
|
StyledTextMetrics {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ BasePill {
|
|||||||
|
|
||||||
if (isMouseWheelY) {
|
if (isMouseWheelY) {
|
||||||
if (deltaY > 0) {
|
if (deltaY > 0) {
|
||||||
activePlayer.previous();
|
MprisController.previousOrRewind();
|
||||||
} else {
|
} else {
|
||||||
activePlayer.next();
|
activePlayer.next();
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ BasePill {
|
|||||||
scrollAccumulatorY += deltaY;
|
scrollAccumulatorY += deltaY;
|
||||||
if (Math.abs(scrollAccumulatorY) >= touchpadThreshold) {
|
if (Math.abs(scrollAccumulatorY) >= touchpadThreshold) {
|
||||||
if (scrollAccumulatorY > 0) {
|
if (scrollAccumulatorY > 0) {
|
||||||
activePlayer.previous();
|
MprisController.previousOrRewind();
|
||||||
} else {
|
} else {
|
||||||
activePlayer.next();
|
activePlayer.next();
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ BasePill {
|
|||||||
if (mouse.button === Qt.LeftButton) {
|
if (mouse.button === Qt.LeftButton) {
|
||||||
activePlayer.togglePlaying();
|
activePlayer.togglePlaying();
|
||||||
} else if (mouse.button === Qt.MiddleButton) {
|
} else if (mouse.button === Qt.MiddleButton) {
|
||||||
activePlayer.previous();
|
MprisController.previousOrRewind();
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
activePlayer.next();
|
activePlayer.next();
|
||||||
}
|
}
|
||||||
@@ -370,11 +370,7 @@ BasePill {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: root.playerAvailable
|
enabled: root.playerAvailable
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: MprisController.previousOrRewind()
|
||||||
if (activePlayer) {
|
|
||||||
activePlayer.previous();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -487,17 +487,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: MprisController.previousOrRewind()
|
||||||
if (!activePlayer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activePlayer.position > 8 && activePlayer.canSeek) {
|
|
||||||
activePlayer.position = 0;
|
|
||||||
} else {
|
|
||||||
activePlayer.previous();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,14 +145,7 @@ Card {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: MprisController.previousOrRewind()
|
||||||
if (!activePlayer) return
|
|
||||||
if (activePlayer.position > 8 && activePlayer.canSeek) {
|
|
||||||
activePlayer.position = 0
|
|
||||||
} else {
|
|
||||||
activePlayer.previous()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1338,7 +1338,7 @@ Item {
|
|||||||
enabled: MprisController.activePlayer?.canGoPrevious ?? false
|
enabled: MprisController.activePlayer?.canGoPrevious ?? false
|
||||||
hoverEnabled: enabled
|
hoverEnabled: enabled
|
||||||
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
onClicked: MprisController.activePlayer?.previous()
|
onClicked: MprisController.previousOrRewind()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,20 @@ Singleton {
|
|||||||
|
|
||||||
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
||||||
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying) ?? availablePlayers.find(p => p.canControl && p.canPlay) ?? null
|
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying) ?? availablePlayers.find(p => p.canControl && p.canPlay) ?? null
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 1000
|
||||||
|
running: root.activePlayer?.playbackState === MprisPlaybackState.Playing
|
||||||
|
repeat: true
|
||||||
|
onTriggered: root.activePlayer?.positionChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
function previousOrRewind(): void {
|
||||||
|
if (!activePlayer)
|
||||||
|
return;
|
||||||
|
if (activePlayer.position > 8 && activePlayer.canSeek)
|
||||||
|
activePlayer.position = 0;
|
||||||
|
else if (activePlayer.canGoPrevious)
|
||||||
|
activePlayer.previous();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user