1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01: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() void WebInspector::updateCloseButton()
{ {
page()->runJavaScript(QL1S("var button = document.getElementsByClassName('toolbar-close-button-item')[0];" page()->runJavaScript(QL1S("var toolbar = document.getElementsByClassName('inspector-view-toolbar')[1];"
"button.style.display = 'inline-block';" "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() {" "button.addEventListener('click', function() {"
" window.close();" " window.close();"
"})")); "});"
"toolbar.appendChild(button);"));
} }
void WebInspector::keyPressEvent(QKeyEvent *event) void WebInspector::keyPressEvent(QKeyEvent *event)