]> git.lyx.org Git - features.git/commitdiff
Fullscreen support: Small cleanups. Still not sure why the scrollbar is not properly...
authorAbdelrazak Younes <younes@lyx.org>
Wed, 20 Feb 2008 14:27:52 +0000 (14:27 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 20 Feb 2008 14:27:52 +0000 (14:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23075 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiWorkArea.cpp

index 456c3ffbed52568e6943e23507db731e5ba67595..0b6fb260c28f9f6216abfdbbf16723a73fdb1099 100644 (file)
@@ -1868,29 +1868,23 @@ void GuiView::lfunUiToggle(FuncRequest const & cmd)
                d.toolbars_->toggleFullScreen(!isFullScreen());
 
        if (isFullScreen()) {
-               showNormal();
+               for (int i = 0; i != d.splitter_->count(); ++i)
+                       d.tabWorkArea(i)->setFullScreen(false);
 #if QT_VERSION >= 0x040300
                setContentsMargins(0, 0, 0, 0);
 #endif
-               for (int i = 0; i != d.splitter_->count(); ++i)
-                       d.tabWorkArea(i)->setFullScreen(false);
+               showNormal();
                menuBar()->show();
                statusBar()->show();
-               if (lyxrc.full_screen_scrollbar && d.current_work_area_)
-                       d.current_work_area_->
-                               setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
        } else {
-               if (lyxrc.full_screen_scrollbar && d.current_work_area_)
-                       d.current_work_area_->
-                               setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-               statusBar()->hide();
-               menuBar()->hide();
                for (int i = 0; i != d.splitter_->count(); ++i)
                        d.tabWorkArea(i)->setFullScreen(true);
 #if QT_VERSION >= 0x040300
                setContentsMargins(-2, -2, -2, -2);
 #endif
                showFullScreen();
+               statusBar()->hide();
+               menuBar()->hide();
        }
 }
 
index 0b2428f32e55bbb489b089810a0bd39445166200..42e1903dcf2c262f4b48a9261e22344a83449c32 100644 (file)
@@ -259,8 +259,15 @@ void GuiWorkArea::close()
 
 void GuiWorkArea::setFullScreen(bool full_screen)
 {
-       setFrameStyle(QFrame::NoFrame);
        buffer_view_->setFullScreen(full_screen);
+       if (full_screen) {
+               setFrameStyle(QFrame::NoFrame);
+               if (lyxrc.full_screen_scrollbar)
+                       setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+       } else {
+               setFrameStyle(QFrame::Box);
+               setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+       }
 }