Commit a66705f8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement replaceInnerHtml in webengine

parent 8c019a6a
......@@ -2900,6 +2900,10 @@ QString ViewerPrivate::recipientsQuickListLinkHtml(bool doShow, const QString &f
void ViewerPrivate::toggleFullAddressList(const QString &field)
{
const bool doShow = (field == QLatin1String("To") && showFullToAddressList()) || (field == QLatin1String("Cc") && showFullCcAddressList());
#ifdef MESSAGEVIEWER_USE_QTWEBENGINE
//TODO
qDebug() << "void ViewerPrivate::toggleFullAddressList(const QString &field) not implemented";
#else
// First inject the correct icon
if (mViewer->replaceInnerHtml(QLatin1String("iconFull") + field + QLatin1String("AddressList"),
bind(&ViewerPrivate::recipientsQuickListLinkHtml, this, doShow, field))) {
......@@ -2907,6 +2911,7 @@ void ViewerPrivate::toggleFullAddressList(const QString &field)
mViewer->setElementByIdVisible(QLatin1String("dotsFull") + field + QLatin1String("AddressList"), !doShow);
mViewer->setElementByIdVisible(QLatin1String("hiddenFull") + field + QLatin1String("AddressList"), doShow);
}
#endif
}
void ViewerPrivate::itemFetchResult(KJob *job)
......
......@@ -172,3 +172,18 @@ QString WebEngineScript::scrollToRelativePosition(int pos)
const QString source = QString::fromLatin1("window.scrollTo(window.scrollX, %1); [window.scrollX, window.scrollY];").arg(pos);
return source;
}
QString WebEngineScript::replaceInnerHtml()
{
#if 0
// First inject the correct icon
if (mViewer->replaceInnerHtml(QLatin1String("iconFull") + field + QLatin1String("AddressList"),
bind(&ViewerPrivate::recipientsQuickListLinkHtml, this, doShow, field))) {
// Then show/hide the full address list
mViewer->setElementByIdVisible(QLatin1String("dotsFull") + field + QLatin1String("AddressList"), !doShow);
mViewer->setElementByIdVisible(QLatin1String("hiddenFull") + field + QLatin1String("AddressList"), doShow);
}
#endif
//TODO
return {};
}
......@@ -38,6 +38,7 @@ MESSAGEVIEWER_EXPORT QString scrollUp(int pixel);
MESSAGEVIEWER_EXPORT QString scrollPercentage(int percent);
MESSAGEVIEWER_EXPORT QString scrollToRelativePosition(int pos);
MESSAGEVIEWER_EXPORT QString removeStyleToElement(const QString &element);
MESSAGEVIEWER_EXPORT QString replaceInnerHtml();
}
}
#endif // WEBENGINESCRIPT_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment