From e854afb5d30423be9f18fbb99313e29bbb7c87ab Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 22 May 2015 23:30:51 +0200 Subject: [PATCH] TabbedWebView: Bring back showing hovered link url in statusbar --- src/lib/other/statusbarmessage.cpp | 5 +++-- src/lib/webtab/tabbedwebview.cpp | 15 +++------------ src/lib/webtab/tabbedwebview.h | 4 ++-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/lib/other/statusbarmessage.cpp b/src/lib/other/statusbarmessage.cpp index 4e217f731..cf442d7c0 100644 --- a/src/lib/other/statusbarmessage.cpp +++ b/src/lib/other/statusbarmessage.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2015 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -130,9 +130,10 @@ void StatusBarMessage::showMessage(const QString &message) int horizontalScrollSize = 0; int verticalScrollSize = 0; - const int scrollbarSize = m_window->style()->pixelMetric(QStyle::PM_ScrollBarExtent); #if QTWEBENGINE_DISABLED + const int scrollbarSize = m_window->style()->pixelMetric(QStyle::PM_ScrollBarExtent); + if (mainFrame->scrollBarMaximum(Qt::Horizontal)) { horizontalScrollSize = scrollbarSize; } diff --git a/src/lib/webtab/tabbedwebview.cpp b/src/lib/webtab/tabbedwebview.cpp index 09e8bf809..af4327e28 100644 --- a/src/lib/webtab/tabbedwebview.cpp +++ b/src/lib/webtab/tabbedwebview.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2015 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,9 +57,7 @@ void TabbedWebView::setWebPage(WebPage* page) page->setParent(this); setPage(page); -#if QTWEBENGINE_DISABLED - connect(page, SIGNAL(linkHovered(QString,QString,QString)), this, SLOT(linkHovered(QString,QString,QString))); -#endif + connect(page, &WebPage::linkHovered, this, &TabbedWebView::linkHovered); } BrowserWindow* TabbedWebView::browserWindow() const @@ -160,20 +158,13 @@ void TabbedWebView::setIp(const QHostInfo &info) } } -void TabbedWebView::linkHovered(const QString &link, const QString &title, const QString &content) +void TabbedWebView::linkHovered(const QString &link) { - Q_UNUSED(title) - Q_UNUSED(content) - if (m_webTab->isCurrentTab() && m_window) { if (link.isEmpty()) { m_window->statusBarMessage()->clearMessage(); } else { - // QUrl::fromEncoded(link.toUtf8()); - // Don't decode link from percent encoding (to show all utf8 chars), as it doesn't - // works correctly in all cases - // See #1095 m_window->statusBarMessage()->showMessage(link); } } diff --git a/src/lib/webtab/tabbedwebview.h b/src/lib/webtab/tabbedwebview.h index c45895d98..b373991df 100644 --- a/src/lib/webtab/tabbedwebview.h +++ b/src/lib/webtab/tabbedwebview.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2015 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ private slots: void slotLoadFinished(); void slotLoadProgress(int prog); void urlChanged(const QUrl &url); - void linkHovered(const QString &link, const QString &title, const QString &content); + void linkHovered(const QString &link); void setIp(const QHostInfo &info); void inspectElement();