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

Fixed showing progressbar when opening new tab from <a target="_blank">

- search button in websearchbar no longer shows context menu
   = fixed possible focus issue
This commit is contained in:
nowrep 2012-03-06 21:27:37 +01:00
parent eb7de9a104
commit 5ea084c09d
5 changed files with 36 additions and 8 deletions

View File

@ -34,6 +34,19 @@
#include <QWebFrame>
#include <QClipboard>
WebSearchBar_Button::WebSearchBar_Button(QWidget *parent)
: ClickableLabel(parent)
{
setObjectName("websearchbar-searchbutton");
setCursor(QCursor(Qt::PointingHandCursor));
setFocusPolicy(Qt::ClickFocus);
}
void WebSearchBar_Button::contextMenuEvent(QContextMenuEvent *event)
{
event->accept();
}
WebSearchBar::WebSearchBar(QupZilla* mainClass, QWidget* parent)
: LineEdit(parent)
, p_QupZilla(mainClass)
@ -42,10 +55,8 @@ WebSearchBar::WebSearchBar(QupZilla* mainClass, QWidget* parent)
, m_clearAction(0)
{
setObjectName("websearchbar");
m_buttonSearch = new ClickableLabel(this);
m_buttonSearch->setObjectName("websearchbar-searchbutton");
m_buttonSearch->setCursor(QCursor(Qt::PointingHandCursor));
m_buttonSearch->setFocusPolicy(Qt::ClickFocus);
m_buttonSearch = new WebSearchBar_Button(this);
m_boxSearchType = new ButtonWithMenu(this);
m_boxSearchType->setObjectName("websearchbar-searchprovider-comobobox");

View File

@ -24,6 +24,7 @@
#include "lineedit.h"
#include "buttonwithmenu.h"
#include "searchenginesmanager.h"
#include "clickablelabel.h"
class QStringListModel;
@ -34,6 +35,15 @@ class SearchEnginesManager;
class SearchEnginesDialog;
class OpenSearchEngine;
class QT_QUPZILLA_EXPORT WebSearchBar_Button : public ClickableLabel
{
public:
explicit WebSearchBar_Button(QWidget* parent = 0);
private:
void contextMenuEvent(QContextMenuEvent *event);
};
class QT_QUPZILLA_EXPORT WebSearchBar : public LineEdit
{
Q_OBJECT
@ -76,7 +86,7 @@ private:
QupZilla* p_QupZilla;
ClickableLabel* m_buttonSearch;
WebSearchBar_Button* m_buttonSearch;
ButtonWithMenu* m_boxSearchType;
SearchEnginesManager* m_searchManager;
QWeakPointer<SearchEnginesDialog> m_searchDialog;

View File

@ -125,8 +125,7 @@ void PopupWebPage::checkBehaviour()
TabbedWebView* view = p_QupZilla->weView(index);
view->setWebPage(this);
if (m_isLoading) {
view->slotLoadStarted();
view->loadingProgress(m_progress);
view->fakePageLoading(m_progress);
}
}
}

View File

@ -386,6 +386,13 @@ void TabbedWebView::disconnectObjects()
WebView::disconnectObjects();
}
void TabbedWebView::fakePageLoading(int progress)
{
WebView::slotLoadStarted();
slotLoadStarted();
loadingProgress(progress);
}
TabbedWebView::~TabbedWebView()
{
}

View File

@ -50,9 +50,10 @@ public:
bool hasRss() { return m_hasRss; }
QWidget* overlayForJsAlert();
void disconnectObjects();
void fakePageLoading(int progress);
signals:
void wantsCloseTab(int);
void ipChanged(QString);