]> git.lyx.org Git - features.git/commitdiff
- hum... truly fix the cursor.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 12 Nov 2006 08:29:05 +0000 (08:29 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 12 Nov 2006 08:29:05 +0000 (08:29 +0000)
- 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

index 59c190c97b0277967eb9e01eeb40d144370c1b51..fcd51f37148a4471ba95e936abd32ceaa47590de 100644 (file)
@@ -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());
 }