mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
WebInspector: Show close button only when docked
This commit is contained in:
parent
74fc271e25
commit
1af76cb2a9
|
@ -55,7 +55,6 @@ PopupWindow::PopupWindow(PopupWebView* view)
|
||||||
m_menuBar = new QMenuBar(this);
|
m_menuBar = new QMenuBar(this);
|
||||||
|
|
||||||
QMenu* menuFile = new QMenu(tr("File"));
|
QMenu* menuFile = new QMenu(tr("File"));
|
||||||
menuFile->addAction(QIcon::fromTheme("document-save"), tr("&Save Page As..."), m_view, SLOT(savePageAs()))->setShortcut(QKeySequence("Ctrl+S"));
|
|
||||||
menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, SLOT(sendPageByMail()));
|
menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, SLOT(sendPageByMail()));
|
||||||
//menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, SLOT(printPage()))->setShortcut(QKeySequence("Ctrl+P"));
|
//menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, SLOT(printPage()))->setShortcut(QKeySequence("Ctrl+P"));
|
||||||
menuFile->addSeparator();
|
menuFile->addSeparator();
|
||||||
|
|
|
@ -89,19 +89,21 @@ void WebInspector::unregisterView(QWebEngineView *view)
|
||||||
|
|
||||||
void WebInspector::loadFinished()
|
void WebInspector::loadFinished()
|
||||||
{
|
{
|
||||||
// Update close button
|
// Show close button only when docked
|
||||||
page()->runJavaScript(QL1S("var toolbar = document.getElementsByClassName('inspector-view-toolbar')[1];"
|
if (!isWindow()) {
|
||||||
"var button = document.createElement('button');"
|
page()->runJavaScript(QL1S("var toolbar = document.getElementsByClassName('inspector-view-toolbar')[1];"
|
||||||
"button.style.width = '22px';"
|
"var button = document.createElement('button');"
|
||||||
"button.style.height = '22px';"
|
"button.style.width = '22px';"
|
||||||
"button.style.border = 'none';"
|
"button.style.height = '22px';"
|
||||||
"button.style.cursor = 'pointer';"
|
"button.style.border = 'none';"
|
||||||
"button.style.background = 'url(qrc:html/close.png) no-repeat';"
|
"button.style.cursor = 'pointer';"
|
||||||
"button.style.backgroundPosition = 'center center';"
|
"button.style.background = 'url(qrc:html/close.png) no-repeat';"
|
||||||
"button.addEventListener('click', function() {"
|
"button.style.backgroundPosition = 'center center';"
|
||||||
" window.close();"
|
"button.addEventListener('click', function() {"
|
||||||
"});"
|
" window.close();"
|
||||||
"toolbar.appendChild(button);"));
|
"});"
|
||||||
|
"toolbar.appendChild(button);"));
|
||||||
|
}
|
||||||
|
|
||||||
// Inspect element
|
// Inspect element
|
||||||
if (m_inspectElement) {
|
if (m_inspectElement) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user