Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
a66705f8
Commit
a66705f8
authored
Apr 02, 2016
by
Laurent Montel
Browse files
Start to implement replaceInnerHtml in webengine
parent
8c019a6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/viewer/viewer_p.cpp
View file @
a66705f8
...
...
@@ -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
)
...
...
messageviewer/src/webengine/webenginescript.cpp
View file @
a66705f8
...
...
@@ -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
{};
}
messageviewer/src/webengine/webenginescript.h
View file @
a66705f8
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment