From 7c4c797dbc24fc39c88e6a160a606afa8c1a199d Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 16 May 2021 02:24:46 +1200 Subject: [PATCH] Fix word backspacing not closing/updating colon emote picker (#2781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł --- CHANGELOG.md | 1 + src/widgets/splits/SplitInput.cpp | 7 +++++++ src/widgets/splits/SplitInput.hpp | 1 + 3 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abac2cd38..da4043880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Bugfix: `Login expired` message no longer highlights all tabs. (#2735) - Bugfix: Fix a deadlock that would occur during user badge loading. (#1704, #2756) - Bugfix: Tabbing in `Select a channel to open` is now consistent. (#1797) +- Bugfix: Fix Ctrl + Backspace not closing colon emote picker. (#2780) - Bugfix: Approving/denying AutoMod messages works again. (#2779) - Dev: Migrated AutoMod approve/deny endpoints to Helix. (#2779) diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index b01c2910f..f9fbb6f53 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -86,6 +86,8 @@ void SplitInput::initLayout() app->fonts->getFont(FontStyle::ChatMedium, this->scale())); QObject::connect(this->ui_.textEdit, &QTextEdit::cursorPositionChanged, this, &SplitInput::onCursorPositionChanged); + QObject::connect(this->ui_.textEdit, &QTextEdit::textChanged, this, + &SplitInput::onTextChanged); this->managedConnections_.push_back(app->fonts->fontChanged.connect([=]() { this->ui_.textEdit->setFont( @@ -447,6 +449,11 @@ void SplitInput::installKeyPressedEvent() }); } +void SplitInput::onTextChanged() +{ + this->updateColonMenu(); +} + void SplitInput::onCursorPositionChanged() { this->updateColonMenu(); diff --git a/src/widgets/splits/SplitInput.hpp b/src/widgets/splits/SplitInput.hpp index 00b22ebc7..7e97aa6e3 100644 --- a/src/widgets/splits/SplitInput.hpp +++ b/src/widgets/splits/SplitInput.hpp @@ -46,6 +46,7 @@ private: void initLayout(); void installKeyPressedEvent(); void onCursorPositionChanged(); + void onTextChanged(); void updateEmoteButton(); void updateColonMenu(); void showColonMenu(const QString &text);