+BufferWidget::BufferWidget(QWidget* parent)
+ : AbstractBufferContainer(parent)
+ , _chatViewSearchController(new ChatViewSearchController(this))
+ , _autoMarkerLine(true)
+ , _autoMarkerLineOnLostFocus(true)
+{
+ ui.setupUi(this);
+ layout()->setContentsMargins(0, 0, 0, 0);
+ layout()->setSpacing(0);
+ // ui.searchBar->hide();
+
+ _chatViewSearchController->setCaseSensitive(ui.searchBar->caseSensitiveBox()->isChecked());
+ _chatViewSearchController->setSearchSenders(ui.searchBar->searchSendersBox()->isChecked());
+ _chatViewSearchController->setSearchMsgs(ui.searchBar->searchMsgsBox()->isChecked());
+ _chatViewSearchController->setSearchOnlyRegularMsgs(ui.searchBar->searchOnlyRegularMsgsBox()->isChecked());
+
+ connect(ui.searchBar, &ChatViewSearchBar::searchChanged, _chatViewSearchController, &ChatViewSearchController::setSearchString);
+ connect(ui.searchBar->caseSensitiveBox(), &QAbstractButton::toggled, _chatViewSearchController, &ChatViewSearchController::setCaseSensitive);
+ connect(ui.searchBar->searchSendersBox(), &QAbstractButton::toggled, _chatViewSearchController, &ChatViewSearchController::setSearchSenders);
+ connect(ui.searchBar->searchMsgsBox(), &QAbstractButton::toggled, _chatViewSearchController, &ChatViewSearchController::setSearchMsgs);
+ connect(ui.searchBar->searchOnlyRegularMsgsBox(),
+ &QAbstractButton::toggled,
+ _chatViewSearchController,
+ &ChatViewSearchController::setSearchOnlyRegularMsgs);
+ connect(ui.searchBar->searchUpButton(), &QAbstractButton::clicked, _chatViewSearchController, &ChatViewSearchController::highlightPrev);
+ connect(ui.searchBar->searchDownButton(), &QAbstractButton::clicked, _chatViewSearchController, &ChatViewSearchController::highlightNext);