]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Do not unnecessarily reset the outliner to TOC on internal model changes
[features.git] / src / BufferView.cpp
index 52baf098effbc620d1b7482af0db482005799cfc..b36b8ee5b6a694fc226862fead4a719e370946bb 100644 (file)
@@ -342,11 +342,14 @@ int BufferView::defaultMargin() const
 
 int BufferView::rightMargin() const
 {
-       // The additional test for the case the outliner is opened.
-       if (full_screen_ && lyxrc.full_screen_limit)
-               return max(defaultMargin(), (width_ - lyxrc.full_screen_width) / 2);
+       const int screen_width = inPixels(lyxrc.screen_width);
 
-       return defaultMargin();
+       // The additional test for the case the outliner is opened.
+       if (!lyxrc.screen_limit || width_ < screen_width + 2 * defaultMargin()) {
+               return defaultMargin();
+       } else {
+               return (width_ - screen_width) / 2;
+       }
 }