From b87d73147b681d548c11785004c21e469c026391 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 22 Sep 2012 12:36:01 +0200 Subject: Re-enable fullscreen capabilities --- src/tabwindow/tabbar.cpp | 5 +++++ src/tabwindow/tabwindow.cpp | 11 +++++++++++ src/tabwindow/tabwindow.h | 2 ++ 3 files changed, 18 insertions(+) (limited to 'src/tabwindow') diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp index 18393cf9..a1e69745 100644 --- a/src/tabwindow/tabbar.cpp +++ b/src/tabwindow/tabbar.cpp @@ -102,6 +102,11 @@ QSize TabBar::tabSizeHint(int index) const int h = size().height(); + // this because it may happen sometimes (eg: exiting fullscreen) + // that tabbar height is set to ZERO. And this is NOT good... + if (h == 0) + h = 30; + QSize ts = QSize(w, h); return ts; } diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp index ba355e51..297653e8 100644 --- a/src/tabwindow/tabwindow.cpp +++ b/src/tabwindow/tabwindow.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -146,6 +147,8 @@ WebWindow *TabWindow::prepareNewTab(WebPage *page) connect(tab, SIGNAL(pageCreated(WebPage *)), this, SLOT(pageCreated(WebPage *))); + connect(tab, SIGNAL(setFullScreen(bool)), this, SLOT(setFullScreen(bool))); + return tab; } @@ -490,3 +493,11 @@ void TabWindow::restoreClosedTab(int i) // just to get sure... m_recentlyClosedTabs.removeAll(history); } + + +void TabWindow::setFullScreen(bool makeFullScreen) +{ + tabBar()->setVisible(!makeFullScreen); + _addTabButton->setVisible(!makeFullScreen); + KToggleFullScreenAction::setFullScreen(this, makeFullScreen); +} diff --git a/src/tabwindow/tabwindow.h b/src/tabwindow/tabwindow.h index 750cac5f..882ca4e9 100644 --- a/src/tabwindow/tabwindow.h +++ b/src/tabwindow/tabwindow.h @@ -100,6 +100,8 @@ private Q_SLOTS: void reloadAllTabs(); void restoreClosedTab(int i); + void setFullScreen(bool); + private: // the new tab button QToolButton *_addTabButton; -- cgit v1.2.1