]> git.lyx.org Git - features.git/commitdiff
* WorkArea
authorAbdelrazak Younes <younes@lyx.org>
Sat, 4 Nov 2006 07:29:25 +0000 (07:29 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 4 Nov 2006 07:29:25 +0000 (07:29 +0000)
  - hasFocus(): new pure virtual method
  - redraw(): update singlePar only if the Widget has the focusInEvent

* GuiWorkArea.h: implement hasFocus().

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

src/frontends/WorkArea.C
src/frontends/WorkArea.h
src/frontends/qt4/GuiWorkArea.h

index 17fc8cfc386fa8464641680536ca76ecf723757d..0d65d628cc83f476bd9b2893ffc40d3bfb8da62d 100644 (file)
@@ -148,7 +148,7 @@ void WorkArea::redraw(bool singlePar)
                return;
        }
 
-       buffer_view_->updateMetrics(singlePar);
+       buffer_view_->updateMetrics(singlePar && hasFocus());
 
        updateScrollbar();
 
index ec7f4ba5ff02f834c6604ecff5686b6539407332..90638d5c929ba32a04dceccc5656d1d45160fff0 100644 (file)
@@ -65,6 +65,9 @@ public:
        ///
        BufferView const & bufferView() const;
 
+       /// \return true if has the keyboard input focus.
+       virtual bool hasFocus() const = 0;
+       
        /// return the width of the work area in pixels
        virtual int width() const = 0;
 
index 8745d3e4164f151f94767825ec10aaf631a8d539..ab62eeae95c3150bd19eabca4056dc9a45cad4ba 100644 (file)
@@ -94,6 +94,9 @@ public:
        ///
        GuiWorkArea(int width, int height, int id, LyXView & lyx_view);
 
+       ///
+       bool hasFocus() const { return QAbstractScrollArea::hasFocus(); }
+
        /// return the width of the content pane
        virtual int width() const { return viewport()->width(); }
        /// return the height of the content pane