From a32d1c063c45161e920304236c7929c3aef3adc9 Mon Sep 17 00:00:00 2001 From: fourtf Date: Sun, 7 Jan 2018 00:05:32 +0100 Subject: [PATCH] searching is now case insensitive --- src/widgets/helper/channelview.cpp | 1 + src/widgets/helper/searchpopup.cpp | 4 +++- src/widgets/scrollbar.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index 665f91b2..21d72b2f 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -466,6 +466,7 @@ void ChannelView::setChannel(std::shared_ptr newChannel) this->userPopupWidget.setChannel(newChannel); this->layoutMessages(); + this->queueUpdate(); } void ChannelView::detachChannel() diff --git a/src/widgets/helper/searchpopup.cpp b/src/widgets/helper/searchpopup.cpp index 1a3a9a29..b8aa72bc 100644 --- a/src/widgets/helper/searchpopup.cpp +++ b/src/widgets/helper/searchpopup.cpp @@ -76,7 +76,9 @@ void SearchPopup::performSearch() for (size_t i = 0; i < this->snapshot.getLength(); i++) { messages::SharedMessage message = this->snapshot[i]; - if (text.isEmpty() || message->getContent().indexOf(this->searchInput->text()) != -1) { + if (text.isEmpty() || + message->getContent().indexOf(this->searchInput->text(), 0, Qt::CaseInsensitive) != + -1) { channel->addMessage(message); } } diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index 4b662d53..08755bf6 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -226,7 +226,7 @@ void Scrollbar::paintEvent(QPaintEvent *) int w = this->width(); float y = 0; - float dY = (float)(this->height() + MIN_THUMB_HEIGHT) / (float)snapshotLength; + float dY = (float)(this->height()) / (float)snapshotLength; int highlightHeight = std::ceil(dY); for (int i = 0; i < snapshotLength; i++) {