From 4fa214a38a8927b5c3470386e6b0f71bc4ce50aa Mon Sep 17 00:00:00 2001 From: kornes <28986062+kornes@users.noreply.github.com> Date: Sat, 3 Dec 2022 18:14:15 +0000 Subject: [PATCH] Prepopulate search window input with current text selection (#4178) Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> --- CHANGELOG.md | 1 + src/widgets/helper/SearchPopup.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdff1275..97722f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Minor: Search window input will automatically use currently selected text if present. (#4178) - Minor: Cleared up highlight sound settings (#4194) - Bugfix: Fixed highlight sounds not reloading on change properly. (#4194) - Bugfix: Fixed CTRL + C not working in reply thread popups. (#4209) diff --git a/src/widgets/helper/SearchPopup.cpp b/src/widgets/helper/SearchPopup.cpp index 8afd8bb8..990e6759 100644 --- a/src/widgets/helper/SearchPopup.cpp +++ b/src/widgets/helper/SearchPopup.cpp @@ -62,6 +62,12 @@ SearchPopup::SearchPopup(QWidget *parent, Split *split) , split_(split) { this->initLayout(); + if (this->split_ && this->split_->getChannelView().hasSelection()) + { + this->searchInput_->setText( + this->split_->getChannelView().getSelectedText().trimmed()); + this->searchInput_->selectAll(); + } this->resize(400, 600); this->addShortcuts(); }