diff --git a/src/lib/popupwindow/popupwebview.cpp b/src/lib/popupwindow/popupwebview.cpp index f86043b09..c6b5b9901 100644 --- a/src/lib/popupwindow/popupwebview.cpp +++ b/src/lib/popupwindow/popupwebview.cpp @@ -57,7 +57,7 @@ PopupWebPage* PopupWebView::webPage() return m_page; } -QWidget* PopupWebView::overlayForJsAlert() +QWidget* PopupWebView::overlayWidget() { return this; } diff --git a/src/lib/popupwindow/popupwebview.h b/src/lib/popupwindow/popupwebview.h index 5b889e16f..2b016f479 100644 --- a/src/lib/popupwindow/popupwebview.h +++ b/src/lib/popupwindow/popupwebview.h @@ -34,7 +34,7 @@ public: void setWebPage(PopupWebPage* page); PopupWebPage* webPage(); - QWidget* overlayForJsAlert(); + QWidget* overlayWidget(); void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position); signals: diff --git a/src/lib/webkit/webpage.cpp b/src/lib/webkit/webpage.cpp index 7d8881d6b..84b69f7d4 100644 --- a/src/lib/webkit/webpage.cpp +++ b/src/lib/webkit/webpage.cpp @@ -889,7 +889,7 @@ bool WebPage::javaScriptPrompt(QWebFrame* originatingFrame, const QString &msg, } WebView* webView = qobject_cast(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(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(originatingFrame->page()->view()); - ResizableFrame* widget = new ResizableFrame(webView->overlayForJsAlert()); + ResizableFrame* widget = new ResizableFrame(webView->overlayWidget()); widget->setObjectName("jsFrame"); Ui_jsAlert* ui = new Ui_jsAlert(); diff --git a/src/lib/webkit/webview.h b/src/lib/webkit/webview.h index 5ef2b22e4..0ea017702 100644 --- a/src/lib/webkit/webview.h +++ b/src/lib/webkit/webview.h @@ -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); diff --git a/src/lib/webtab/tabbedwebview.cpp b/src/lib/webtab/tabbedwebview.cpp index fd797efcf..68078bef7 100644 --- a/src/lib/webtab/tabbedwebview.cpp +++ b/src/lib/webtab/tabbedwebview.cpp @@ -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; } diff --git a/src/lib/webtab/tabbedwebview.h b/src/lib/webtab/tabbedwebview.h index 101dbff4b..39f94bed7 100644 --- a/src/lib/webtab/tabbedwebview.h +++ b/src/lib/webtab/tabbedwebview.h @@ -48,7 +48,7 @@ public: BrowserWindow* mainWindow() const; void moveToWindow(BrowserWindow* window); - QWidget* overlayForJsAlert(); + QWidget* overlayWidget(); signals: void wantsCloseTab(int); diff --git a/src/plugins/AccessKeysNavigation/akn_handler.cpp b/src/plugins/AccessKeysNavigation/akn_handler.cpp index 9ac6df46f..f978cb671 100644 --- a/src/plugins/AccessKeysNavigation/akn_handler.cpp +++ b/src/plugins/AccessKeysNavigation/akn_handler.cpp @@ -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("%1")).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); diff --git a/src/plugins/AutoScroll/autoscroller.cpp b/src/plugins/AutoScroll/autoscroller.cpp index ede96684b..61595256c 100644 --- a/src/plugins/AutoScroll/autoscroller.cpp +++ b/src/plugins/AutoScroll/autoscroller.cpp @@ -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();