Added margin to emote search (#3543)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
qooq69 2022-03-26 14:46:22 +01:00 committed by GitHub
parent 554313d645
commit 3c46572c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -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)

View file

@ -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<QAbstractButton *>()->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);