]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiToolbars.cpp
fix some compiler warnings
[features.git] / src / frontends / qt4 / GuiToolbars.cpp
index 43b98086919fd45bff4d472359f8fd14a1ac7d25..dda0b7873b9cbf16369e0b74ec2ba7d3fbb52d41 100644 (file)
@@ -25,6 +25,7 @@
 #include "Layout.h"
 #include "LyX.h"
 #include "LyXFunc.h"
+#include "TextClass.h"
 #include "ToolbarBackend.h"
 
 #include "support/debug.h"
@@ -137,7 +138,7 @@ void GuiToolbars::init()
                LYXERR(Debug::INIT, "Adding " << tb->key << " at position "
                        << tb->info.posx << " " << tb->info.posy);
                // add toolbar break if posx or posy changes
-       bool newline = tb->info.location == last_loc && (
+               bool newline = tb->info.location == last_loc && (
                        // if two toolbars at the same location, assume uninitialized and add toolbar break
                        (tb->info.posx == last_posx && tb->info.posy == last_posy) ||
                        (last_loc == ToolbarSection::ToolbarInfo::TOP && tb->info.posy != last_posy) ||
@@ -224,15 +225,20 @@ void GuiToolbars::toggleToolbarState(string const & name, bool allowauto)
 
 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;
+       int flags = 0;
 
        for (; cit != end; ++cit) {
 
                if (start_full_screen) {
-                       flags = cit->before_fullscreen = cit->flags;
+                       if (toolbarbackend.fullScreenWindows == 1)
+                               flags = cit->before_fullscreen = cit->flags;
                        TurnOffFlag(ON);
                        TurnOffFlag(AUTO);
                        TurnOnFlag(OFF);