From c6d55e0d8c34b77b85fa9beb217cc81a1217789b Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sat, 12 Dec 2020 13:06:40 +0100 Subject: [PATCH] Improve search popup window titles (#2268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds special cases for /whispers, /mentions and empty tabs, and an apostrophe in the titles. Co-authored-by: Paweł --- CHANGELOG.md | 1 + src/widgets/helper/SearchPopup.cpp | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e174a74c..36deb4934 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Major: Added "Channel Filters". See https://wiki.chatterino.com/Filters/ for how they work or how to configure them. (#1748, #2083, #2090, #2200) - Major: Added Streamer Mode configuration (under `Settings -> General`), where you can select which features of Chatterino should behave differently when you are in Streamer Mode. (#2001) +- Minor: Improved search popup window titles. (#2268) - Minor: Made "#channel" in `/mentions` tab a clickable link which takes you to the channel that you were mentioned in. (#2220) - Minor: Added a keyboard shortcut (Ctrl+F5) for "Reconnect" (#2215) - Minor: Made `Try to find usernames without @ prefix` option still resolve usernames when special characters (commas, dots, (semi)colons, exclamation mark, question mark) are appended to them. (#2212) diff --git a/src/widgets/helper/SearchPopup.cpp b/src/widgets/helper/SearchPopup.cpp index f79b3f061..e213c8fbd 100644 --- a/src/widgets/helper/SearchPopup.cpp +++ b/src/widgets/helper/SearchPopup.cpp @@ -81,7 +81,25 @@ void SearchPopup::setChannel(const ChannelPtr &channel) void SearchPopup::updateWindowTitle() { - this->setWindowTitle("Searching in " + this->channelName_ + "s history"); + QString historyName; + + if (this->channelName_ == "/whispers") + { + historyName = "whispers"; + } + else if (this->channelName_ == "/mentions") + { + historyName = "mentions"; + } + else if (this->channelName_.isEmpty()) + { + historyName = "'s"; + } + else + { + historyName = QString("%1's").arg(this->channelName_); + } + this->setWindowTitle("Searching in " + historyName + " history"); } void SearchPopup::search()