Commit 623281bd authored by Laurent Montel's avatar Laurent Montel 😁

Reactivate some code

parent ba456a0a
......@@ -257,9 +257,7 @@ void MailWebEngineView::scrollPageDown(int percent)
void MailWebEngineView::scrollPageUp(int percent)
{
#if 0
scrollPageDown(-percent);
#endif
}
void MailWebEngineView::injectAttachments(const boost::function<QString()> &delayedHtml)
......@@ -311,11 +309,12 @@ bool MailWebEngineView::isAttachmentInjectionPoint(const QPoint &globalPos) cons
void MailWebEngineView::scrollToRelativePosition(double pos)
{
//TODO
page()->runJavaScript(MessageViewer::WebEngineScript::scrollToRelativePosition(pos));
}
double MailWebEngineView::relativePosition() const
{
//TODO
return {};
}
......
......@@ -158,3 +158,10 @@ QString WebEngineScript::setStyleToElement(const QString &elementStr, const QStr
"}").arg(elementStr).arg(style);
return source;
}
QString WebEngineScript::scrollToRelativePosition(int pos)
{
//TODO verify it
const QString source = QString::fromLatin1("window.scrollTo(window.scrollX, %1); [window.scrollX, window.scrollY];").arg(pos);
return source;
}
......@@ -36,6 +36,7 @@ MESSAGEVIEWER_EXPORT QString setStyleToElement(const QString &elementStr, const
MESSAGEVIEWER_EXPORT QString scrollDown(int pixel);
MESSAGEVIEWER_EXPORT QString scrollUp(int pixel);
MESSAGEVIEWER_EXPORT QString scrollPercentage(int percent);
MESSAGEVIEWER_EXPORT QString scrollToRelativePosition(int pos);
}
}
#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