]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiToolbars.cpp
fix some compiler warnings
[features.git] / src / frontends / qt4 / GuiToolbars.cpp
index 25fc333b2893349c9913a123fc9ed59d16a7eb2a..dda0b7873b9cbf16369e0b74ec2ba7d3fbb52d41 100644 (file)
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "support/debug.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "support/gettext.h"
 #include "Layout.h"
 #include "LyX.h"
 #include "LyXFunc.h"
 #include "TextClass.h"
 #include "ToolbarBackend.h"
 
+#include "support/debug.h"
+#include "support/gettext.h"
+
 using namespace std;
 
 namespace lyx {
@@ -220,6 +221,33 @@ void GuiToolbars::toggleToolbarState(string const & name, bool allowauto)
        }
        tbi->flags = static_cast<ToolbarInfo::Flags>(flags);
 }
+
+
+void GuiToolbars::toggleFullScreen(bool start_full_screen)
+{
+       // we need to know number of fullscreens until every
+       // LyXView has its own toolbar configuration
+       toolbarbackend.fullScreenWindows += start_full_screen ? 1 : -1;
+
+       // extracts the toolbars from the backend
+       ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
+       ToolbarBackend::Toolbars::iterator end = toolbarbackend.end();
+       int flags = 0;
+
+       for (; cit != end; ++cit) {
+
+               if (start_full_screen) {
+                       if (toolbarbackend.fullScreenWindows == 1)
+                               flags = cit->before_fullscreen = cit->flags;
+                       TurnOffFlag(ON);
+                       TurnOffFlag(AUTO);
+                       TurnOnFlag(OFF);
+               } else
+                       flags = cit->before_fullscreen;
+
+               cit->flags = static_cast<ToolbarInfo::Flags>(flags);
+       }
+}
 #undef TurnOnFlag
 #undef TurnOffFlag