1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

WebInspector: Fix close button with QtWebEngine 5.6

This commit is contained in:
David Rosca 2015-10-10 00:12:14 +02:00
parent 56e5237697
commit 7e238f69b0

View File

@ -81,11 +81,17 @@ void WebInspector::unregisterView(QWebEngineView *view)
void WebInspector::updateCloseButton()
{
page()->runJavaScript(QL1S("var button = document.getElementsByClassName('toolbar-close-button-item')[0];"
"button.style.display = 'inline-block';"
page()->runJavaScript(QL1S("var toolbar = document.getElementsByClassName('inspector-view-toolbar')[1];"
"var button = document.createElement('button');"
"button.style.width = '26px';"
"button.style.height = '26px';"
"button.style.border = 'none';"
"button.style.background = 'url(qrc:html/close.png) no-repeat';"
"button.style.backgroundPosition = 'center center';"
"button.addEventListener('click', function() {"
" window.close();"
"})"));
"});"
"toolbar.appendChild(button);"));
}
void WebInspector::keyPressEvent(QKeyEvent *event)