From 96bca52d0d6e4a81384b986246937526a550916e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Thu, 2 Mar 2023 17:21:04 +0100 Subject: [PATCH] fix keybinds --- assets/userscript.js | 10 ++++------ src/userscript.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/assets/userscript.js b/assets/userscript.js index 7b925cb..ce34476 100644 --- a/assets/userscript.js +++ b/assets/userscript.js @@ -139,10 +139,12 @@ setTimeout(() => { function main() { userscript.muteToggled.connect(() => { + console.log("Toggling mute"); muteBtn && muteBtn.click(); }); userscript.deafenToggled.connect(() => { + console.log("Toggling deafen"); deafenBtn && deafenBtn.click(); }); @@ -285,15 +287,11 @@ function main() { } muteBtn = buttonContainer - ? buttonContainer.getElementsByClassName( - "button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F" - )[0] + ? buttonContainer.getElementsByTagName("button")[0] : null; deafenBtn = buttonContainer - ? buttonContainer.getElementsByClassName( - "button-12Fmur enabled-9OeuTA button-f2h6uQ lookBlank-21BCro colorBrand-I6CyqQ grow-2sR_-F" - )[1] + ? buttonContainer.getElementsByTagName("button")[1] : null; if (resolutionString) { diff --git a/src/userscript.cpp b/src/userscript.cpp index 9402907..3a7e1c2 100644 --- a/src/userscript.cpp +++ b/src/userscript.cpp @@ -62,7 +62,7 @@ void UserScript::setupShortcutsDialog() { auto toggleDeafenAction = new QAction(this); toggleDeafenAction->setText("Toggle Deafen"); toggleDeafenAction->setIcon(QIcon::fromTheme("audio-volume-muted")); - connect(toggleMuteAction, &QAction::triggered, this, + connect(toggleDeafenAction, &QAction::triggered, this, &UserScript::deafenToggled); m_actionCollection = new KActionCollection(this);