GuiWorkArea::Private::Private(GuiWorkArea * parent)
-: p(parent), buffer_view_(0), lyx_view_(0), cursor_visible_(false),
+: p(parent), screen_(0), buffer_view_(0), lyx_view_(0), cursor_visible_(false),
need_resize_(false), schedule_redraw_(false), preedit_lines_(1),
completer_(new GuiCompleter(p, p))
{
GuiWorkArea::~GuiWorkArea()
{
d->buffer_view_->buffer().workAreaManager().remove(this);
+ delete d->screen_;
delete d->buffer_view_;
delete d->cursor_;
// Completer has a QObject parent and is thus automatically destroyed.
void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
{
- docstring name;
+ string name;
if (e->reason() == QContextMenuEvent::Mouse)
// the menu name is set on mouse press
name = d->context_menu_name_;
void GuiWorkArea::focusInEvent(QFocusEvent * e)
{
LYXERR(Debug::DEBUG, "GuiWorkArea::focusInEvent(): " << this << endl);
- if (d->lyx_view_->currentWorkArea() != this)
+ if (d->lyx_view_->currentWorkArea() != this) {
d->lyx_view_->setCurrentWorkArea(this);
+ d->lyx_view_->currentWorkArea()->bufferView().buffer().updateBuffer();
+ }
startBlinkingCursor();
QAbstractScrollArea::focusInEvent(e);
}
QPainter pain(viewport());
-#ifdef USE_QIMAGE
- pain.drawImage(rc, d->screen_, rc);
-#else
- pain.drawPixmap(rc, d->screen_, rc);
-#endif
+ if (lyxrc.use_qimage) {
+ pain.drawImage(rc, static_cast<QImage const &>(*d->screen_), rc);
+ } else {
+ pain.drawPixmap(rc, static_cast<QPixmap const &>(*d->screen_), rc);
+ }
d->cursor_->draw(pain);
ev->accept();
}
void GuiWorkArea::Private::updateScreen()
{
- GuiPainter pain(&screen_);
+ GuiPainter pain(screen_);
buffer_view_->draw(pain);
}
return;
}
- GuiPainter pain(&d->screen_);
+ GuiPainter pain(d->screen_);
d->buffer_view_->updateMetrics();
d->buffer_view_->draw(pain);
FontInfo font = d->buffer_view_->cursor().getFont().fontInfo();
if (lyxrc.full_screen_tabbar)
showBar(!full_screen && count() > 1);
+ else
+ showBar(count() > 1);
}