mirror of
https://github.com/aunetx/deezer-linux.git
synced 2025-09-25 18:48:52 +02:00
feat(patch): add patch to fix systray/thumbar actions that were not working (play, pause, next, prev)
This commit is contained in:
parent
dad90ea68d
commit
ad14e0adfe
75
patches/14-thumbar-actions.patch
Normal file
75
patches/14-thumbar-actions.patch
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
From 7eb249657ab10516c7dff5d3f3be93b262a8d749 Mon Sep 17 00:00:00 2001
|
||||||
|
From: josselinonduty <contact@josselinonduty.fr>
|
||||||
|
Date: Fri, 15 Aug 2025 01:13:08 +0200
|
||||||
|
Subject: [PATCH] feat: make thumbar actions actually work
|
||||||
|
|
||||||
|
---
|
||||||
|
build/main.js | 23 ++++++++++++++++++-----
|
||||||
|
1 file changed, 18 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/build/main.js b/build/main.js
|
||||||
|
index 315cab4..241dd72 100644
|
||||||
|
--- a/build/main.js
|
||||||
|
+++ b/build/main.js
|
||||||
|
@@ -1598,6 +1598,8 @@
|
||||||
|
return this.getPasteOptions();
|
||||||
|
case MenuItemType.PlayerPlay:
|
||||||
|
return this.getPlayerPlayOptions();
|
||||||
|
+ case MenuItemType.PlayerPlayThumbar:
|
||||||
|
+ return this.getPlayerPlayOptionsThumbar();
|
||||||
|
case MenuItemType.PlayerNext:
|
||||||
|
return this.getPlayerNextOptions();
|
||||||
|
case MenuItemType.PlayerPrev:
|
||||||
|
@@ -1738,15 +1740,26 @@
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
+ getPlayerPlayOptionsThumbar() {
|
||||||
|
+ const { state } = this.media.getPlayerInfo(),
|
||||||
|
+ isPlaying = state === MediaPlayerState.Playing;
|
||||||
|
+ return {
|
||||||
|
+ label: i18n_t(isPlaying ? "menu_pause_label" : "menu_play_label"),
|
||||||
|
+ enabled: this.user.isLoggedIn(),
|
||||||
|
+ click: () => {
|
||||||
|
+ isPlaying ? this.media.pause() : this.media.play();
|
||||||
|
+ },
|
||||||
|
+ };
|
||||||
|
+ }
|
||||||
|
getPlayerNextOptions() {
|
||||||
|
const { canNext } = this.media.getPlayerInfo();
|
||||||
|
return {
|
||||||
|
label: i18n_t("menu_next_label"),
|
||||||
|
enabled: this.user.isLoggedIn() && canNext,
|
||||||
|
accelerator: "Shift+Right",
|
||||||
|
- click: noAcceleratorTrigger(() => {
|
||||||
|
+ click: () => {
|
||||||
|
this.media.next();
|
||||||
|
- }),
|
||||||
|
+ },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
getPlayerPrevOptions() {
|
||||||
|
@@ -1755,9 +1768,9 @@
|
||||||
|
label: i18n_t("menu_previous_label"),
|
||||||
|
enabled: this.user.isLoggedIn() && canPrev,
|
||||||
|
accelerator: "Shift+Left",
|
||||||
|
- click: noAcceleratorTrigger(() => {
|
||||||
|
+ click: () => {
|
||||||
|
this.media.prev();
|
||||||
|
- }),
|
||||||
|
+ },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
getPlayerShuffleOptions() {
|
||||||
|
@@ -2410,7 +2423,7 @@
|
||||||
|
external_electron_namespaceObject.Menu.buildFromTemplate([
|
||||||
|
this.menu.getItem(MenuItemType.Open),
|
||||||
|
this.menu.getItem(MenuItemType.Separator),
|
||||||
|
- this.menu.getItem(MenuItemType.PlayerPlay),
|
||||||
|
+ this.menu.getItem(MenuItemType.PlayerPlayThumbar),
|
||||||
|
this.menu.getItem(MenuItemType.PlayerNext),
|
||||||
|
this.menu.getItem(MenuItemType.PlayerPrev),
|
||||||
|
this.menu.getItem(MenuItemType.Separator),
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user