Fixes to ctrl+backspace behavior (#5013)
This commit is contained in:
@@ -227,6 +227,7 @@ EmotePopup::EmotePopup(QWidget *parent)
|
||||
this->search_->setClearButtonEnabled(true);
|
||||
this->search_->findChild<QAbstractButton *>()->setIcon(
|
||||
QPixmap(":/buttons/clearSearch.png"));
|
||||
this->search_->installEventFilter(this);
|
||||
layout2->addWidget(this->search_);
|
||||
|
||||
layout->addLayout(layout2);
|
||||
@@ -448,6 +449,21 @@ void EmotePopup::loadChannel(ChannelPtr channel)
|
||||
}
|
||||
}
|
||||
|
||||
bool EmotePopup::eventFilter(QObject *object, QEvent *event)
|
||||
{
|
||||
if (object == this->search_ && event->type() == QEvent::KeyPress)
|
||||
{
|
||||
auto *keyEvent = dynamic_cast<QKeyEvent *>(event);
|
||||
if (keyEvent == QKeySequence::DeleteStartOfWord &&
|
||||
this->search_->selectionLength() > 0)
|
||||
{
|
||||
this->search_->backspace();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EmotePopup::filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
|
||||
const QString &searchText)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user