shape_ = shape;
}
- void show(bool set_show = false) { show_ = set_show; }
+ void show(bool set_show = true) { show_ = set_show; }
void hide() { show_ = false; }
+ QRect const & rect() { return rect_; }
+
private:
///
CursorShape shape_;
h += height() / 4;
int scroll_max_ = std::max(0, h - height());
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
verticalScrollBar()->setRange(0, scroll_max_);
verticalScrollBar()->setSliderPosition(scroll_pos);
verticalScrollBar()->setSingleStep(scroll_line_step);
void GuiWorkArea::resizeEvent(QResizeEvent * ev)
{
- cursor_->hide();
+ stopBlinkingCursor();
screen_ = QPixmap(ev->size().width(), ev->size().height());
verticalScrollBar()->setPageStep(viewport()->height());
QAbstractScrollArea::resizeEvent(ev);
resizeBufferView();
+ startBlinkingCursor();
}
{
cursor_->update(x, y, h, shape);
cursor_->show();
+ viewport()->update(cursor_->rect());
}
void GuiWorkArea::removeCursor()
{
- if (!qApp->focusWidget())
- return;
cursor_->hide();
+ //if (!qApp->focusWidget())
+ viewport()->update(cursor_->rect());
}