From 3e293bb6927500efdcfdc08905c8716b5aeb2319 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 9 Feb 2008 18:29:15 +0000 Subject: [PATCH] Handle full screen mode for all work areas. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22904 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 10 ++++------ src/frontends/qt4/GuiWorkArea.cpp | 9 +++++++++ src/frontends/qt4/GuiWorkArea.h | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 929dd8097e..ffda79e6d7 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1848,17 +1848,15 @@ void GuiView::lfunUiToggle(FuncRequest const & cmd) #if QT_VERSION >= 0x040300 setContentsMargins(0, 0, 0, 0); #endif - // FIXME: it is not enough to take care of the current work area. - // All work areas are affected by a full screen mode! - d.current_work_area_->setFullScreen(false); + for (int i = 0; i != d.splitter_->count(); ++i) + d.tabWorkArea(i)->setFullScreen(false); menuBar()->show(); statusBar()->show(); } else { statusBar()->hide(); menuBar()->hide(); - // FIXME: it is not enough to take care of the current work area. - // All work areas are affected by a full screen mode! - d.current_work_area_->setFullScreen(true); + for (int i = 0; i != d.splitter_->count(); ++i) + d.tabWorkArea(i)->setFullScreen(true); #if QT_VERSION >= 0x040300 setContentsMargins(-2, -2, -2, -2); #endif diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 60e48f7cbf..5091037b22 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -1047,6 +1047,15 @@ TabWorkArea::TabWorkArea(QWidget * parent) : QTabWidget(parent) } +void TabWorkArea::setFullScreen(bool full_screen) +{ + for (int i = 0; i != count(); ++i) { + if (GuiWorkArea * wa = dynamic_cast(widget(i))) + wa->setFullScreen(full_screen); + } +} + + void TabWorkArea::showBar(bool show) { tabBar()->setEnabled(show); diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index ddfcabf18b..0da12f8e3c 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -239,6 +239,8 @@ class TabWorkArea : public QTabWidget public: TabWorkArea(QWidget * parent = 0); + /// + void setFullScreen(bool full_screen); void showBar(bool show); void closeAll(); bool setCurrentWorkArea(GuiWorkArea *); -- 2.39.5