mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
SearchToolbar: Remove "Highlight" option
It is no longer available with QWebEngine. Also rewrite callback to use lambda instead of invoke wrapper.
This commit is contained in:
parent
406f522c61
commit
0723deb2fc
@ -24,22 +24,6 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QShortcut>
|
||||
|
||||
template<typename Arg, typename R, typename C>
|
||||
struct InvokeWrapper {
|
||||
R* receiver;
|
||||
void (C::*memberFun)(Arg);
|
||||
void operator()(Arg result) {
|
||||
(receiver->*memberFun)(result);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Arg, typename R, typename C>
|
||||
InvokeWrapper<Arg, R, C> invoke(R* receiver, void (C::*memberFun)(Arg))
|
||||
{
|
||||
InvokeWrapper<Arg, R, C> wrapper = {receiver, memberFun};
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
SearchToolBar::SearchToolBar(WebView* view, QWidget* parent)
|
||||
: AnimatedWidget(AnimatedWidget::Up, 300, parent)
|
||||
, ui(new Ui::SearchToolbar)
|
||||
@ -133,7 +117,9 @@ void SearchToolBar::caseSensitivityChanged()
|
||||
|
||||
void SearchToolBar::searchText(const QString &text)
|
||||
{
|
||||
m_view->findText(text, m_findFlags, invoke(this, &SearchToolBar::handleSearchResult));
|
||||
m_view->findText(text, m_findFlags, [this](bool found) {
|
||||
handleSearchResult(found);
|
||||
});
|
||||
}
|
||||
|
||||
void SearchToolBar::handleSearchResult(bool found)
|
||||
@ -149,7 +135,6 @@ void SearchToolBar::handleSearchResult(bool found)
|
||||
ui->results->clear();
|
||||
}
|
||||
|
||||
|
||||
ui->lineEdit->setProperty("notfound", QVariant(!found));
|
||||
|
||||
ui->lineEdit->style()->unpolish(ui->lineEdit);
|
||||
|
@ -82,16 +82,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MacToolButton" name="highligh">
|
||||
<property name="text">
|
||||
<string>Highlight</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MacToolButton" name="caseSensitive">
|
||||
<property name="text">
|
||||
|
Loading…
Reference in New Issue
Block a user