mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-21 07:12:10 +00:00
rename BufferView::center() to showCursor().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22222 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7998dfd948
commit
2e8fdbb54b
@ -374,7 +374,7 @@ void BufferView::processUpdateFlags(Update::flags flags)
|
|||||||
|| flags == (Update::Decoration | Update::FitCursor)) {
|
|| flags == (Update::Decoration | Update::FitCursor)) {
|
||||||
// tell the frontend to update the screen if needed.
|
// tell the frontend to update the screen if needed.
|
||||||
if (fitCursor()) {
|
if (fitCursor()) {
|
||||||
center();
|
showCursor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flags & Update::Decoration) {
|
if (flags & Update::Decoration) {
|
||||||
@ -391,7 +391,7 @@ void BufferView::processUpdateFlags(Update::flags flags)
|
|||||||
|
|
||||||
if (full_metrics || !singleParUpdate()) {
|
if (full_metrics || !singleParUpdate()) {
|
||||||
if (flags & Update::FitCursor && fitCursor()) {
|
if (flags & Update::FitCursor && fitCursor()) {
|
||||||
center();
|
showCursor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// We have to update the full screen metrics.
|
// 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
|
// The screen needs to be recentered around the cursor position so
|
||||||
// refresh it:
|
// refresh it:
|
||||||
center();
|
showCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -638,7 +638,7 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
|
|||||||
// So we need a redraw!
|
// So we need a redraw!
|
||||||
buffer_.changed();
|
buffer_.changed();
|
||||||
if (fitCursor())
|
if (fitCursor())
|
||||||
center();
|
showCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
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
|
// We are not properly started yet, delay until resizing is
|
||||||
// done.
|
// done.
|
||||||
@ -1074,7 +1074,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_SCREEN_RECENTER:
|
case LFUN_SCREEN_RECENTER:
|
||||||
center();
|
showCursor();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BIBTEX_DATABASE_ADD: {
|
case LFUN_BIBTEX_DATABASE_ADD: {
|
||||||
@ -1174,7 +1174,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
Point p = getPos(cur, cur.boundary());
|
Point p = getPos(cur, cur.boundary());
|
||||||
if (p.y_ < 0 || p.y_ > height_) {
|
if (p.y_ < 0 || p.y_ > height_) {
|
||||||
// The cursor is off-screen so recenter before proceeding.
|
// The cursor is off-screen so recenter before proceeding.
|
||||||
center();
|
showCursor();
|
||||||
p = getPos(cur, cur.boundary());
|
p = getPos(cur, cur.boundary());
|
||||||
}
|
}
|
||||||
scroll(cmd.action == LFUN_SCREEN_UP? - height_ : height_);
|
scroll(cmd.action == LFUN_SCREEN_UP? - height_ : height_);
|
||||||
|
@ -125,8 +125,10 @@ public:
|
|||||||
/// set the cursor based on the given TeX source row.
|
/// set the cursor based on the given TeX source row.
|
||||||
void setCursorFromRow(int row);
|
void setCursorFromRow(int row);
|
||||||
|
|
||||||
/// center the document view around the cursor.
|
/// Ensure the cursor is visible.
|
||||||
void center();
|
/// This method will automatically scroll and update the BufferView and updated
|
||||||
|
/// if needed.
|
||||||
|
void showCursor();
|
||||||
/// scroll down document by the given number of pixels.
|
/// scroll down document by the given number of pixels.
|
||||||
void scrollDown(int pixels);
|
void scrollDown(int pixels);
|
||||||
/// scroll up document by the given number of pixels.
|
/// scroll up document by the given number of pixels.
|
||||||
@ -273,9 +275,6 @@ private:
|
|||||||
///
|
///
|
||||||
Buffer & buffer_;
|
Buffer & buffer_;
|
||||||
|
|
||||||
///
|
|
||||||
void updateOffsetRef();
|
|
||||||
|
|
||||||
struct Private;
|
struct Private;
|
||||||
Private * const d;
|
Private * const d;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user