From 1bf31889f9f3c4db013aede00f3479058467d0c3 Mon Sep 17 00:00:00 2001 From: xel86 Date: Sat, 14 May 2022 07:44:18 -0400 Subject: [PATCH] Fixed viewer list not being closable with the escape key (#3734) --- CHANGELOG.md | 1 + src/widgets/splits/Split.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7ebc7a0..cc4499ccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Bugfix: Fixed highlights triggering from own resub messages. (#3707) - Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713) - Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718) +- Bugfix: Fixed viewer list not closing after pressing escape key. (#3734) - Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662) ## 2.3.5 diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index b67b8c569..8ee377f41 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -1067,6 +1067,27 @@ void Split::showViewerList() listDoubleClick(resultList->currentItem()->text()); }); + HotkeyController::HotkeyMap actions{ + {"delete", + [viewerDock](std::vector) -> QString { + viewerDock->close(); + return ""; + }}, + {"accept", nullptr}, + {"reject", nullptr}, + {"scrollPage", nullptr}, + {"openTab", nullptr}, + {"search", + [searchBar](std::vector) -> QString { + searchBar->setFocus(); + searchBar->selectAll(); + return ""; + }}, + }; + + getApp()->hotkeys->shortcutsForCategory(HotkeyCategory::PopupWindow, + actions, viewerDock); + dockVbox->addWidget(searchBar); dockVbox->addWidget(loadingLabel); dockVbox->addWidget(chattersList);