From 3c46572c51aa484ef0f000349ceecbe137d3e4db Mon Sep 17 00:00:00 2001 From: qooq69 <52359859+qooq69@users.noreply.github.com> Date: Sat, 26 Mar 2022 14:46:22 +0100 Subject: [PATCH] Added margin to emote search (#3543) Co-authored-by: pajlada --- CHANGELOG.md | 2 +- src/widgets/dialogs/EmotePopup.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39bad50bb..dda3dd504 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ - Minor: Added autocompletion for default Twitch commands starting with the dot (e.g. `.mods` which does the same as `/mods`). (#3144) - Minor: Sorted usernames in `Users joined/parted` messages alphabetically. (#3421) - Minor: Mod list, VIP list, and Users joined/parted messages are now searchable. (#3426) -- Minor: Add search to emote popup. (#3404, #3527) +- Minor: Add search to emote popup. (#3404, #3527, #3543) - Minor: Messages can now be highlighted by subscriber or founder badges. (#3445) - Minor: User timeout buttons can now be triggered using hotkeys. (#3483) - Minor: Add workaround for multipart emoji as described in [the RFC](https://mm2pl.github.io/emoji_rfc.pdf). (#3469) diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index e45a99f55..fc43d2800 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -168,13 +168,22 @@ EmotePopup::EmotePopup(QWidget *parent) searchRegex.setPatternOptions(QRegularExpression::CaseInsensitiveOption); QValidator *searchValidator = new QRegularExpressionValidator(searchRegex); + layout->setMargin(0); + layout->setSpacing(0); + + QHBoxLayout *layout2 = new QHBoxLayout(this); + layout2->setMargin(8); + layout2->setSpacing(8); + this->search_ = new QLineEdit(); this->search_->setPlaceholderText("Search all emotes..."); this->search_->setValidator(searchValidator); this->search_->setClearButtonEnabled(true); this->search_->findChild()->setIcon( QPixmap(":/buttons/clearSearch.png")); - layout->addWidget(this->search_); + layout2->addWidget(this->search_); + + layout->addLayout(layout2); QObject::connect(this->search_, &QLineEdit::textChanged, this, &EmotePopup::filterEmotes);