+ // Create search box
+ m_searchInput = new QLineEdit(this);
+ m_searchInput->setPlaceholderText(i18n("Search..."));
+ m_searchInput->installEventFilter(this);
+ m_searchInput->setClearButtonEnabled(true);
+ m_searchInput->setFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
+ connect(m_searchInput, &QLineEdit::returnPressed,
+ this, &DolphinSearchBox::slotReturnPressed);
+ connect(m_searchInput, &QLineEdit::textChanged,
+ this, &DolphinSearchBox::slotSearchTextChanged);
+ setFocusProxy(m_searchInput);
+
+ // Add "Save search" button inside search box
+ m_saveSearchAction = new QAction(this);
+ m_saveSearchAction->setIcon (QIcon::fromTheme(QStringLiteral("document-save-symbolic")));
+ m_saveSearchAction->setText(i18nc("action:button", "Save this search to quickly access it again in the future"));
+ m_saveSearchAction->setEnabled(false);
+ m_searchInput->addAction(m_saveSearchAction, QLineEdit::TrailingPosition);
+ connect(m_saveSearchAction, &QAction::triggered, this, &DolphinSearchBox::slotSearchSaved);
+