]> git.lyx.org Git - features.git/commitdiff
Fullscreen mode fixes:
authorPavel Sanda <sanda@lyx.org>
Wed, 27 Feb 2008 21:04:33 +0000 (21:04 +0000)
committerPavel Sanda <sanda@lyx.org>
Wed, 27 Feb 2008 21:04:33 +0000 (21:04 +0000)
- tabbar & frames respect fullscreen mode when adding/removing new tab.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23291 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.cpp
src/frontends/qt4/GuiWorkArea.h

index 50dad561e77318824d009d503667e20c594df0f7..f97fd0bb12fadccf33cd35050dd63a6ae3f9a782 100644 (file)
@@ -1066,6 +1066,12 @@ void GuiWorkArea::setReadOnly(bool)
 }
 
 
+bool GuiWorkArea::isFullScreen()
+{
+       return lyx_view_ && lyx_view_->isFullScreen();
+}
+
+
 ////////////////////////////////////////////////////////////////////
 //
 // TabWorkArea 
@@ -1192,12 +1198,17 @@ GuiWorkArea * TabWorkArea::addWorkArea(Buffer & buffer, GuiView & view)
        wa->setUpdatesEnabled(false);
        // Hide tabbar if there's no tab (avoid a resize and a flashing tabbar
        // when hiding it again below).
-       showBar(count() > 0);
+       if (!(currentWorkArea() && currentWorkArea()->isFullScreen()))
+               showBar(count() > 0);
        addTab(wa, wa->windowTitle());
        QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
                this, SLOT(updateTabText(GuiWorkArea *)));
-       // Hide tabbar if there's only one tab.
-       showBar(count() > 1);
+       if (currentWorkArea() && currentWorkArea()->isFullScreen())
+               setFullScreen(true);
+       else
+               // Hide tabbar if there's only one tab.
+               showBar(count() > 1);
+
        return wa;
 }
 
@@ -1216,8 +1227,11 @@ bool TabWorkArea::removeWorkArea(GuiWorkArea * work_area)
        if (count()) {
                // make sure the next work area is enabled.
                currentWidget()->setUpdatesEnabled(true);
-               // Hide tabbar if there's only one tab.
-               showBar(count() > 1);
+               if ((currentWorkArea() && currentWorkArea()->isFullScreen()))
+                       setFullScreen(true);
+               else
+                       // Hide tabbar if there's only one tab.
+                       showBar(count() > 1);
        }
        return true;
 }
index 5f73b3178ca380bf224c4100a73a8926ab6fa683..a609557220cb7d25011223875f69837a20eee2ca 100644 (file)
@@ -116,6 +116,8 @@ public:
 
        ///
        void setFullScreen(bool full_screen);
+       /// is LyXView in fullscreen mode?
+       bool isFullScreen();
        ///
        void scheduleRedraw() { schedule_redraw_ = true; }
        ///