]> git.lyx.org Git - features.git/commitdiff
rename BufferView::center() to showCursor().
authorAbdelrazak Younes <younes@lyx.org>
Fri, 21 Dec 2007 08:35:43 +0000 (08:35 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 21 Dec 2007 08:35:43 +0000 (08:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22222 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/BufferView.h

index 49aaa241833064522e03132c47c395e051c6ad50..8b720f2d33d155c2cb323613c7be1e3a97922579 100644 (file)
@@ -374,7 +374,7 @@ void BufferView::processUpdateFlags(Update::flags flags)
                || flags == (Update::Decoration | Update::FitCursor)) {
                // tell the frontend to update the screen if needed.
                if (fitCursor()) {
-                       center();
+                       showCursor();
                        return;
                }
                if (flags & Update::Decoration) {
@@ -391,7 +391,7 @@ void BufferView::processUpdateFlags(Update::flags flags)
 
        if (full_metrics || !singleParUpdate()) {
                if (flags & Update::FitCursor && fitCursor()) {
-                       center();
+                       showCursor();
                        return;
                }
                // We have to update the full screen metrics.
@@ -415,7 +415,7 @@ void BufferView::processUpdateFlags(Update::flags flags)
 
        // The screen needs to be recentered around the cursor position so
        // refresh it:
-       center();
+       showCursor();
 }
 
 
@@ -638,7 +638,7 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
                // So we need a redraw!
                buffer_.changed();
                if (fitCursor())
-                       center();
+                       showCursor();
        }
 
        return success;
@@ -667,7 +667,7 @@ int BufferView::workWidth() const
 }
 
 
-void BufferView::center()
+void BufferView::showCursor()
 {
        // We are not properly started yet, delay until resizing is
        // done.
@@ -1074,7 +1074,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
                break;
 
        case LFUN_SCREEN_RECENTER:
-               center();
+               showCursor();
                break;
 
        case LFUN_BIBTEX_DATABASE_ADD: {
@@ -1174,7 +1174,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
                Point p = getPos(cur, cur.boundary());
                if (p.y_ < 0 || p.y_ > height_) {
                        // The cursor is off-screen so recenter before proceeding.
-                       center();
+                       showCursor();
                        p = getPos(cur, cur.boundary());
                }
                scroll(cmd.action == LFUN_SCREEN_UP? - height_ : height_);
index 31514e480800e2d064a6ab86962da646a0d24f21..c6c045a0082384c85bafd991015b99e5c6261b9b 100644 (file)
@@ -125,8 +125,10 @@ public:
        /// set the cursor based on the given TeX source row.
        void setCursorFromRow(int row);
 
-       /// center the document view around the cursor.
-       void center();
+       /// Ensure the cursor is visible.
+       /// This method will automatically scroll and update the BufferView and updated 
+       /// if needed.
+       void showCursor();
        /// scroll down document by the given number of pixels.
        void scrollDown(int pixels);
        /// scroll up document by the given number of pixels.
@@ -273,9 +275,6 @@ private:
        ///
        Buffer & buffer_;
 
-       ///
-       void updateOffsetRef();
-
        struct Private;
        Private * const d;
 };