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
6 changed files with 7 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ Resources2::Resources2()
this->buttons.addSplitDark = QPixmap(":/buttons/addSplitDark.png");
this->buttons.ban = QPixmap(":/buttons/ban.png");
this->buttons.banRed = QPixmap(":/buttons/banRed.png");
this->buttons.clearSearch = QPixmap(":/buttons/clearSearch.png");
this->buttons.copyDark = QPixmap(":/buttons/copyDark.png");
this->buttons.copyLight = QPixmap(":/buttons/copyLight.png");
this->buttons.menuDark = QPixmap(":/buttons/menuDark.png");
+1
View File
@@ -24,6 +24,7 @@ public:
QPixmap addSplitDark;
QPixmap ban;
QPixmap banRed;
QPixmap clearSearch;
QPixmap copyDark;
QPixmap copyLight;
QPixmap menuDark;
+3
View File
@@ -86,6 +86,9 @@ void SettingsDialog::initUi()
.emplace<QLineEdit>()
.assign(&this->ui_.search);
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,
&SettingsDialog::filterElements);