Add clear button to settings search bar (#3403)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Adam Davies 2021-12-26 08:05:14 -06:00 committed by GitHub
parent 5938e00508
commit f64047d5ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 0 deletions

View file

@ -38,6 +38,7 @@
- Minor: Show picked outcome in prediction badges. (#3357) - Minor: Show picked outcome in prediction badges. (#3357)
- Minor: Add support for Emoji in IRC (#3354) - Minor: Add support for Emoji in IRC (#3354)
- Minor: Moved `/live` logs to its own subdirectory. (Logs from before this change will still be available in `Channels -> live`). (#3393) - Minor: Moved `/live` logs to its own subdirectory. (Logs from before this change will still be available in `Channels -> live`). (#3393)
- Minor: Added clear button to settings search bar. (#3403)
- Minor: Added autocompletion for default Twitch commands starting with the dot (e.g. `.mods` which does the same as `/mods`). (#3144) - 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: Sorted usernames in `Users joined/parted` messages alphabetically. (#3421)
- Minor: Mod list, VIP list, and Users joined/parted messages are now searchable. (#3426) - Minor: Mod list, VIP list, and Users joined/parted messages are now searchable. (#3426)

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

View file

@ -15,6 +15,7 @@
<file>buttons/addSplitDark.png</file> <file>buttons/addSplitDark.png</file>
<file>buttons/ban.png</file> <file>buttons/ban.png</file>
<file>buttons/banRed.png</file> <file>buttons/banRed.png</file>
<file>buttons/clearSearch.png</file>
<file>buttons/copyDark.png</file> <file>buttons/copyDark.png</file>
<file>buttons/copyDark.svg</file> <file>buttons/copyDark.svg</file>
<file>buttons/copyLight.png</file> <file>buttons/copyLight.png</file>

View file

@ -17,6 +17,7 @@ Resources2::Resources2()
this->buttons.addSplitDark = QPixmap(":/buttons/addSplitDark.png"); this->buttons.addSplitDark = QPixmap(":/buttons/addSplitDark.png");
this->buttons.ban = QPixmap(":/buttons/ban.png"); this->buttons.ban = QPixmap(":/buttons/ban.png");
this->buttons.banRed = QPixmap(":/buttons/banRed.png"); this->buttons.banRed = QPixmap(":/buttons/banRed.png");
this->buttons.clearSearch = QPixmap(":/buttons/clearSearch.png");
this->buttons.copyDark = QPixmap(":/buttons/copyDark.png"); this->buttons.copyDark = QPixmap(":/buttons/copyDark.png");
this->buttons.copyLight = QPixmap(":/buttons/copyLight.png"); this->buttons.copyLight = QPixmap(":/buttons/copyLight.png");
this->buttons.menuDark = QPixmap(":/buttons/menuDark.png"); this->buttons.menuDark = QPixmap(":/buttons/menuDark.png");

View file

@ -24,6 +24,7 @@ public:
QPixmap addSplitDark; QPixmap addSplitDark;
QPixmap ban; QPixmap ban;
QPixmap banRed; QPixmap banRed;
QPixmap clearSearch;
QPixmap copyDark; QPixmap copyDark;
QPixmap copyLight; QPixmap copyLight;
QPixmap menuDark; QPixmap menuDark;

View file

@ -86,6 +86,9 @@ void SettingsDialog::initUi()
.emplace<QLineEdit>() .emplace<QLineEdit>()
.assign(&this->ui_.search); .assign(&this->ui_.search);
edit->setPlaceholderText("Find in settings... (Ctrl+F by default)"); edit->setPlaceholderText("Find in settings... (Ctrl+F by default)");
edit->setClearButtonEnabled(true);
edit->findChild<QAbstractButton *>()->setIcon(
QPixmap(":/buttons/clearSearch.png"));
QObject::connect(edit.getElement(), &QLineEdit::textChanged, this, QObject::connect(edit.getElement(), &QLineEdit::textChanged, this,
&SettingsDialog::filterElements); &SettingsDialog::filterElements);