From 070aabd69a693acefb8fbd152c467bace3600a67 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 1 May 2009 01:58:29 +0200 Subject: mouseDoubleClickEvent return, as decided with Avaddon --- src/mainview.cpp | 10 ++++++++ src/mainview.h | 69 ++++++++++++++++++++++---------------------------------- 2 files changed, 37 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/mainview.cpp b/src/mainview.cpp index bb016872..d6b86452 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -694,3 +694,13 @@ QLabel *MainView::animatedLoading(int index, bool addMovie) return label; } + +void MainView::mouseDoubleClickEvent(QMouseEvent *event) +{ + if (!childAt(event->pos())) + { + newWebView(true); + return; + } + KTabWidget::mouseDoubleClickEvent(event); +} \ No newline at end of file diff --git a/src/mainview.h b/src/mainview.h index 64c25fc0..ca233872 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -61,6 +61,28 @@ public: MainView(QWidget *parent = 0); ~MainView(); +public: + + UrlBar *urlBar(int index) const; + UrlBar *currentUrlBar() const { return urlBar(-1); } + WebView *webView(int index) const; + QList tabs(); // ? + + // inlines + TabBar *tabBar() const { return m_tabBar; } + StackedUrlBar *urlBarStack() const { return m_urlBars; } + WebView *currentWebView() const { return webView(currentIndex()); } + int webViewIndex(WebView *webView) const { return indexOf(webView); } + KAction *recentlyClosedTabsAction() const { return m_recentlyClosedTabsAction; } + + /** + * show and hide TabBar if user doesn't choose + * "Always Show TabBar" option + * + */ + void showTabBar(); + void clear(); + signals: // tab widget signals @@ -79,48 +101,6 @@ signals: void toolBarVisibilityChangeRequested(bool visible); void printRequested(QWebFrame *frame); -public: -// void setupTabButtons(); - - UrlBar *urlBar(int index) const; - UrlBar *currentUrlBar() const - { - return urlBar(-1); - } - WebView *webView(int index) const; - QList tabs(); // ? - - // inlines - TabBar *tabBar() const - { - return m_tabBar; - } - StackedUrlBar *urlBarStack() const - { - return m_urlBars; - } - WebView *currentWebView() const - { - return webView(currentIndex()); - } - int webViewIndex(WebView *webView) const - { - return indexOf(webView); - } - KAction *recentlyClosedTabsAction() const - { - return m_recentlyClosedTabsAction; - } - - /** - * show and hide TabBar if user doesn't choose - * "Always Show TabBar" option - * - */ - void showTabBar(); - void clear(); - - public slots: /** * Core browser slot. This create a new tab with a WebView inside @@ -180,6 +160,11 @@ private slots: void postLaunch(); +protected: + + virtual void mouseDoubleClickEvent(QMouseEvent *event); + + private: /** -- cgit v1.2.1