mirror of
https://github.com/aunetx/deezer-linux.git
synced 2025-09-21 16:57:59 +02:00
feat(patch): make thumbar actions actually work
This commit is contained in:
commit
ec0f1aab45
1
Makefile
1
Makefile
@ -51,6 +51,7 @@ prepare: clean install_build_deps
|
||||
@echo "11 - Hide Application is offline banner (https://github.com/aunetx/deezer-linux/pull/124)"
|
||||
@echo "12 - Disable animations (https://github.com/aunetx/deezer-linux/pull/133)"
|
||||
@echo "13 - Disable notifications (https://github.com/aunetx/deezer-linux/pull/151)"
|
||||
@echo "14 - Make thumbar actions work (https://github.com/aunetx/deezer-linux/pull/153)"
|
||||
|
||||
@$(foreach p, $(wildcard ./patches/*), patch -p 1 -d $(APP_DIR) < $(p);)
|
||||
|
||||
|
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