From f64047d5ea916e71e4a88c6f54c74ea340847bc8 Mon Sep 17 00:00:00 2001 From: Adam Davies <8650006+acdvs@users.noreply.github.com> Date: Sun, 26 Dec 2021 08:05:14 -0600 Subject: [PATCH] Add clear button to settings search bar (#3403) Co-authored-by: pajlada --- CHANGELOG.md | 1 + resources/buttons/clearSearch.png | Bin 0 -> 278 bytes resources/resources_autogenerated.qrc | 1 + src/autogenerated/ResourcesAutogen.cpp | 1 + src/autogenerated/ResourcesAutogen.hpp | 1 + src/widgets/dialogs/SettingsDialog.cpp | 3 +++ 6 files changed, 7 insertions(+) create mode 100644 resources/buttons/clearSearch.png diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c745c49..60d4fbad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - Minor: Show picked outcome in prediction badges. (#3357) - 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: 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: Sorted usernames in `Users joined/parted` messages alphabetically. (#3421) - Minor: Mod list, VIP list, and Users joined/parted messages are now searchable. (#3426) diff --git a/resources/buttons/clearSearch.png b/resources/buttons/clearSearch.png new file mode 100644 index 0000000000000000000000000000000000000000..881a0dd7bb68eb9c8f3d587ddfb01cfb3325c272 GIT binary patch literal 278 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!*aCb)T&GN#0%V$+NbLktOeH~n z!T%YaZa44(^7eYVIEGZ*dNa*i=zs!;^Wnexch_mNy?N~u`$Fu~F?mMT7^?>68~h8Z zLw}wZv2Bu@n3B;U2% zW&fgnDQdx0kG~C8LSJ28o!X**;ap3#^4oJ2c0UT778+l=t;u`7vnI&)@ju2t>^oQ_ Z7~aY7#0dGgeFS=h!PC{xWt~$(69DviakT&d literal 0 HcmV?d00001 diff --git a/resources/resources_autogenerated.qrc b/resources/resources_autogenerated.qrc index 9589e1717..f4dbb06ed 100644 --- a/resources/resources_autogenerated.qrc +++ b/resources/resources_autogenerated.qrc @@ -15,6 +15,7 @@ buttons/addSplitDark.png buttons/ban.png buttons/banRed.png + buttons/clearSearch.png buttons/copyDark.png buttons/copyDark.svg buttons/copyLight.png diff --git a/src/autogenerated/ResourcesAutogen.cpp b/src/autogenerated/ResourcesAutogen.cpp index 4c5906dac..9c69228c3 100644 --- a/src/autogenerated/ResourcesAutogen.cpp +++ b/src/autogenerated/ResourcesAutogen.cpp @@ -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"); diff --git a/src/autogenerated/ResourcesAutogen.hpp b/src/autogenerated/ResourcesAutogen.hpp index 2c4ba6ce2..43db450e4 100644 --- a/src/autogenerated/ResourcesAutogen.hpp +++ b/src/autogenerated/ResourcesAutogen.hpp @@ -24,6 +24,7 @@ public: QPixmap addSplitDark; QPixmap ban; QPixmap banRed; + QPixmap clearSearch; QPixmap copyDark; QPixmap copyLight; QPixmap menuDark; diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index d8210b325..00f2bd59e 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -86,6 +86,9 @@ void SettingsDialog::initUi() .emplace() .assign(&this->ui_.search); edit->setPlaceholderText("Find in settings... (Ctrl+F by default)"); + edit->setClearButtonEnabled(true); + edit->findChild()->setIcon( + QPixmap(":/buttons/clearSearch.png")); QObject::connect(edit.getElement(), &QLineEdit::textChanged, this, &SettingsDialog::filterElements);