1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

[AutoScroll] Fixed AutoScroll plugin after recent commits

Use WebView::overlayWidget for showing widgets over WebView
This commit is contained in:
nowrep 2014-04-01 16:32:55 +02:00
parent 7369e86a0a
commit 84f117e68e
8 changed files with 11 additions and 12 deletions

View File

@ -57,7 +57,7 @@ PopupWebPage* PopupWebView::webPage()
return m_page;
}
QWidget* PopupWebView::overlayForJsAlert()
QWidget* PopupWebView::overlayWidget()
{
return this;
}

View File

@ -34,7 +34,7 @@ public:
void setWebPage(PopupWebPage* page);
PopupWebPage* webPage();
QWidget* overlayForJsAlert();
QWidget* overlayWidget();
void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position);
signals:

View File

@ -889,7 +889,7 @@ bool WebPage::javaScriptPrompt(QWebFrame* originatingFrame, const QString &msg,
}
WebView* webView = qobject_cast<WebView*>(originatingFrame->page()->view());
ResizableFrame* widget = new ResizableFrame(webView->overlayForJsAlert());
ResizableFrame* widget = new ResizableFrame(webView->overlayWidget());
widget->setObjectName("jsFrame");
Ui_jsPrompt* ui = new Ui_jsPrompt();
@ -933,7 +933,7 @@ bool WebPage::javaScriptConfirm(QWebFrame* originatingFrame, const QString &msg)
}
WebView* webView = qobject_cast<WebView*>(originatingFrame->page()->view());
ResizableFrame* widget = new ResizableFrame(webView->overlayForJsAlert());
ResizableFrame* widget = new ResizableFrame(webView->overlayWidget());
widget->setObjectName("jsFrame");
Ui_jsConfirm* ui = new Ui_jsConfirm();
@ -985,10 +985,9 @@ void WebPage::javaScriptAlert(QWebFrame* originatingFrame, const QString &msg)
dialog.exec();
m_blockAlerts = dialog.isChecked();
#else
WebView* webView = qobject_cast<WebView*>(originatingFrame->page()->view());
ResizableFrame* widget = new ResizableFrame(webView->overlayForJsAlert());
ResizableFrame* widget = new ResizableFrame(webView->overlayWidget());
widget->setObjectName("jsFrame");
Ui_jsAlert* ui = new Ui_jsAlert();

View File

@ -61,7 +61,7 @@ public:
void addNotification(QWidget* notif);
bool eventFilter(QObject* obj, QEvent* event);
virtual QWidget* overlayForJsAlert() = 0;
virtual QWidget* overlayWidget() = 0;
static bool isUrlValid(const QUrl &url);
static QUrl guessUrlFromString(const QString &string);

View File

@ -199,7 +199,7 @@ void TabbedWebView::moveToWindow(BrowserWindow* window)
connect(this, SIGNAL(statusBarMessage(QString)), m_window->statusBar(), SLOT(showMessage(QString)));
}
QWidget* TabbedWebView::overlayForJsAlert()
QWidget* TabbedWebView::overlayWidget()
{
return m_webTab;
}

View File

@ -48,7 +48,7 @@ public:
BrowserWindow* mainWindow() const;
void moveToWindow(BrowserWindow* window);
QWidget* overlayForJsAlert();
QWidget* overlayWidget();
signals:
void wantsCloseTab(int);

View File

@ -352,7 +352,7 @@ void AKN_Handler::hideAccessKeys()
void AKN_Handler::makeAccessKeyLabel(const QChar &accessKey, const QWebElement &element)
{
QLabel* label = new QLabel(m_view.data());
QLabel* label = new QLabel(m_view.data()->overlayWidget());
label->setText(QString(QLatin1String("<b>%1</b>")).arg(accessKey));
QPalette p = QToolTip::palette();
@ -365,8 +365,8 @@ void AKN_Handler::makeAccessKeyLabel(const QChar &accessKey, const QWebElement &
label->setFrameStyle(QFrame::Box | QFrame::Plain);
QPoint point = element.geometry().center();
point -= m_view.data()->page()->currentFrame()->scrollPosition();
label->move(point);
label->show();
label->resize(label->sizeHint());
point.setX(point.x() - label->width() / 2);
label->move(point);
m_accessKeyLabels.append(label);

View File

@ -184,7 +184,7 @@ bool AutoScroller::showIndicator(WebView* view, const QPoint &pos)
p.setX(pos.x() - m_indicator->width() / 2);
p.setY(pos.y() - m_indicator->height() / 2);
m_indicator->setParent(view->parentWidget());
m_indicator->setParent(view->overlayWidget());
m_indicator->move(p);
m_indicator->show();