From a988cd6de148eaf52038239431c05ef26cb618b4 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 12 Nov 2006 08:29:05 +0000 Subject: [PATCH] - hum... truly fix the cursor. - remove unneeded vertical scrollbar policy setting. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15869 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.C | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index 59c190c97b..fcd51f3714 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -134,9 +134,11 @@ public: 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_; @@ -222,7 +224,6 @@ void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step 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); @@ -499,11 +500,12 @@ void GuiWorkArea::mouseDoubleClickEvent(QMouseEvent * e) 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(); } @@ -592,14 +594,15 @@ void GuiWorkArea::showCursor(int x, int y, int h, CursorShape shape) { 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()); }