mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
cleanups and cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21612 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
240e59ae0d
commit
b716616322
@ -328,7 +328,8 @@ void GuiWorkArea::redraw()
|
||||
int const ymin = std::max(vi.y1, 0);
|
||||
int const ymax = vi.p2 < vi.size - 1 ? vi.y2 : viewport()->height();
|
||||
|
||||
expose(0, ymin, viewport()->width(), ymax - ymin);
|
||||
updateScreen();
|
||||
update(0, ymin, viewport()->width(), ymax - ymin);
|
||||
|
||||
//LYXERR(Debug::WORKAREA)
|
||||
//<< " ymin = " << ymin << " width() = " << width()
|
||||
@ -412,15 +413,6 @@ void GuiWorkArea::resizeBufferView()
|
||||
}
|
||||
|
||||
|
||||
void GuiWorkArea::updateScrollbar()
|
||||
{
|
||||
buffer_view_->updateScrollbar();
|
||||
ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
|
||||
setScrollbarParams(scroll_.height, scroll_.position,
|
||||
scroll_.lineScrollHeight);
|
||||
}
|
||||
|
||||
|
||||
void GuiWorkArea::showCursor()
|
||||
{
|
||||
if (cursor_visible_)
|
||||
@ -489,21 +481,23 @@ void GuiWorkArea::toggleCursor()
|
||||
}
|
||||
|
||||
|
||||
void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step)
|
||||
void GuiWorkArea::updateScrollbar()
|
||||
{
|
||||
if (verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOn)
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
|
||||
verticalScrollBar()->setTracking(false);
|
||||
|
||||
buffer_view_->updateScrollbar();
|
||||
ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
|
||||
|
||||
// do what cursor movement does (some grey)
|
||||
h += viewport()->height() / 4;
|
||||
int const h = scroll_.height + viewport()->height() / 4;
|
||||
int scroll_max_ = std::max(0, h - viewport()->height());
|
||||
|
||||
verticalScrollBar()->setRange(0, scroll_max_);
|
||||
verticalScrollBar()->setSliderPosition(scroll_pos);
|
||||
verticalScrollBar()->setSingleStep(scroll_line_step);
|
||||
verticalScrollBar()->setValue(scroll_pos);
|
||||
verticalScrollBar()->setSliderPosition(scroll_.position);
|
||||
verticalScrollBar()->setSingleStep(scroll_.lineScrollHeight);
|
||||
verticalScrollBar()->setValue(scroll_.position);
|
||||
|
||||
verticalScrollBar()->setTracking(true);
|
||||
}
|
||||
@ -754,13 +748,6 @@ void GuiWorkArea::paintEvent(QPaintEvent * ev)
|
||||
}
|
||||
|
||||
|
||||
void GuiWorkArea::expose(int x, int y, int w, int h)
|
||||
{
|
||||
updateScreen();
|
||||
update(x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
void GuiWorkArea::updateScreen()
|
||||
{
|
||||
GuiPainter pain(&screen_);
|
||||
|
@ -110,27 +110,8 @@ public:
|
||||
///
|
||||
~GuiWorkArea();
|
||||
|
||||
/**
|
||||
* Update the scrollbar.
|
||||
* @param height the total document height in pixels
|
||||
* @param pos the current position in the document, in pixels
|
||||
* @param line_height the line-scroll amount, in pixels
|
||||
*/
|
||||
void setScrollbarParams(int height, int pos, int line_height);
|
||||
///
|
||||
void scheduleRedraw() { schedule_redraw_ = true; }
|
||||
|
||||
/// update the passed area.
|
||||
void update(int x, int y, int w, int h);
|
||||
|
||||
/// copies specified area of pixmap to screen
|
||||
virtual void expose(int x, int y, int exp_width, int exp_height);
|
||||
|
||||
/// paint the cursor and store the background
|
||||
virtual void showCursor(int x, int y, int h, CursorShape shape);
|
||||
|
||||
/// hide the cursor
|
||||
virtual void removeCursor();
|
||||
///
|
||||
BufferView & bufferView();
|
||||
///
|
||||
@ -145,7 +126,11 @@ public:
|
||||
/// This needs to be public because it is accessed externally by GuiView.
|
||||
void processKeySym(KeySymbol const & key, KeyModifier mod);
|
||||
|
||||
public Q_SLOTS:
|
||||
Q_SIGNALS:
|
||||
///
|
||||
void titleChanged(GuiWorkArea *);
|
||||
|
||||
private Q_SLOTS:
|
||||
/// Adjust the LyX buffer view with the position of the scrollbar.
|
||||
/**
|
||||
* The action argument is not used in the the code, it is there
|
||||
@ -160,11 +145,18 @@ public Q_SLOTS:
|
||||
/// Slot for Buffer::closing signal.
|
||||
void close();
|
||||
|
||||
Q_SIGNALS:
|
||||
///
|
||||
void titleChanged(GuiWorkArea *);
|
||||
|
||||
private:
|
||||
/// update the passed area.
|
||||
void update(int x, int y, int w, int h);
|
||||
///
|
||||
void updateScreen();
|
||||
|
||||
/// paint the cursor and store the background
|
||||
virtual void showCursor(int x, int y, int h, CursorShape shape);
|
||||
|
||||
/// hide the cursor
|
||||
virtual void removeCursor();
|
||||
|
||||
/// This function is called when the buffer readonly status change.
|
||||
void setReadOnly(bool);
|
||||
|
||||
@ -227,8 +219,6 @@ private:
|
||||
///
|
||||
CursorWidget * cursor_;
|
||||
///
|
||||
void updateScreen();
|
||||
///
|
||||
QPixmap screen_;
|
||||
///
|
||||
bool need_resize_;
|
||||
|
Loading…
Reference in New Issue
Block a user