///
virtual ~WorkArea() {}
- /// redraw the screen, without using existing pixmap
- virtual void redraw(bool update_metrics) = 0;
+ /// Update metrics if needed and schedule a paint event
+ virtual void scheduleRedraw(bool update_metrics) = 0;
/// close this work area.
/// Slot for Buffer::closing signal.
GuiWorkArea::Private::Private(GuiWorkArea * parent)
: p(parent), buffer_view_(0), lyx_view_(0),
caret_(0), caret_visible_(false),
- need_resize_(false), schedule_redraw_(false), preedit_lines_(1),
+ need_resize_(false), preedit_lines_(1),
pixel_ratio_(1.0),
completer_(new GuiCompleter(p, p)), dialog_mode_(false), shell_escape_(false),
read_only_(false), clean_(true), externally_modified_(false)
}
-void GuiWorkArea::redraw(bool update_metrics)
+void GuiWorkArea::scheduleRedraw(bool update_metrics)
{
if (!isVisible())
// No need to redraw in this case.
caret_->update(point.x_, point.y_, h, l_shape, isrtl, completable);
- if (schedule_redraw_) {
- // This happens when a graphic conversion is finished. As we don't know
- // the size of the new graphics, it's better the update everything.
- // We can't use redraw() here because this would trigger a infinite
- // recursive loop with showCaret().
- buffer_view_->resize(p->viewport()->width(), p->viewport()->height());
- p->viewport()->update();
- updateScrollbar();
- schedule_redraw_ = false;
- return;
- }
-
p->viewport()->update(caret_->rect());
}
}
-void GuiWorkArea::scheduleRedraw()
-{
- d->schedule_redraw_ = true;
-}
-
-
bool GuiWorkArea::inDialogMode() const
{
return d->dialog_mode_;
GuiWorkArea * wa = workArea(i);
LASSERT(wa, return);
wa->setUpdatesEnabled(true);
- wa->redraw(true);
+ wa->scheduleRedraw(true);
wa->setFocus();
///
currentWorkAreaChanged(wa);
/// is GuiView in fullscreen mode?
bool isFullScreen() const;
///
- void scheduleRedraw();
- ///
BufferView & bufferView();
///
BufferView const & bufferView() const;
///
- void redraw(bool update_metrics);
+ void scheduleRedraw(bool update_metrics);
/// return true if the key is part of a shortcut
bool queryKeySym(KeySymbol const & key, KeyModifier mod) const;