]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/screen.C
fix rbearing
[lyx.git] / src / frontends / screen.C
index 6f874d9f799fb7f904966357ec12e970bf30f777..c3c3affcc33f5764fa17156c7b563e68052e5130 100644 (file)
@@ -1,9 +1,11 @@
 /**
  * \file screen.C
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon 
+ *
+ * Full author contact details are available in file CREDITS
  *
  * Splash screen code added by Angus Leeming
  */
@@ -16,6 +18,7 @@
 
 #include "screen.h"
 #include "lyxtext.h"
+#include "lyxrc.h"
 #include "lyxrow.h"
 #include "BufferView.h"
 #include "buffer.h"
@@ -80,6 +83,9 @@ SplashScreen const & SplashScreen::get()
 SplashScreen::SplashScreen()
        : text_(lyx_version ? lyx_version : "unknown")
 {
+       if (!lyxrc.show_banner)
+               return;
+
        string const file = LibFileSearch("images", "banner", "xpm");
        if (file.empty())
                return;
@@ -94,8 +100,8 @@ SplashScreen::SplashScreen()
        loader_.reset(file);
        // We aren't interested here in when the image is loaded.
        // If it isn't ready when we want it, then we ignore it.
-//     loader_->statusChanged.connect(
-//                     boost::bind(&SplashScreen::statusChanged, this));
+//     loader_->statusChanged.connect(
+//                     boost::bind(&SplashScreen::statusChanged, this));
        if (loader_.status() == grfx::WaitingToLoad)
                loader_.startLoading();
 }
@@ -189,8 +195,7 @@ unsigned int LyXScreen::topCursorVisible(LyXCursor const & cursor, int top_y)
        if (!row)
                return max(newtop, 0);
 
-       if (cursor.y() - row->baseline() + row->height()
-           - top_y >= vheight) {
+       if (cursor.y() - row->baseline() + row->height() - top_y >= vheight) {
                if (row->height() < vheight
                    && row->height() > vheight / 4) {
                        newtop = cursor.y()
@@ -381,14 +386,14 @@ void LyXScreen::greyOut()
                int const w = splash_image->getWidth();
                int const h = splash_image->getHeight();
 
-               int x = 0.5 * (workarea().workWidth() - w);
-               int y = 0.5 * (workarea().workHeight() - h);
+               int x = (workarea().workWidth() - w) / 2;
+               int y = (workarea().workHeight() - h) / 2;
 
                workarea().getPainter().image(x, y, w, h, *splash_image);
 
                string const & splash_text  = splash.text();
                LyXFont const & splash_font = splash.font();
-               
+
                x += 260;
                y += 265;