]> git.lyx.org Git - lyx.git/commitdiff
cursor cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Mon, 23 Oct 2006 11:34:43 +0000 (11:34 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 23 Oct 2006 11:34:43 +0000 (11:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15504 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.C
src/lyxfunc.C

index f0d447e0af6a4ddb9f3bb8f69edd9a402b2bd129..235fc10dd7f03c1350b65d610fce814d41ad8790 100644 (file)
@@ -184,6 +184,7 @@ GuiWorkArea::GuiWorkArea(int w, int h, LyXView & lyx_view)
        : WorkArea(lyx_view)
 {
        cursor_ = new frontend::CursorWidget(this);
+       cursor_->hide();
 
        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -478,6 +479,7 @@ void GuiWorkArea::mouseDoubleClickEvent(QMouseEvent * e)
 
 void GuiWorkArea::resizeEvent(QResizeEvent * ev)
 {
+       cursor_->hide();
        verticalScrollBar()->setPageStep(viewport()->height());
        //paint_device_ = QPixmap(viewport()->width(), viewport()->height());
        QAbstractScrollArea::resizeEvent(ev);
@@ -597,10 +599,7 @@ void GuiWorkArea::expose(int x, int y, int w, int h)
 
 void GuiWorkArea::showCursor(int x, int y, int h, CursorShape shape)
 {
-       if (!qApp->focusWidget())
-               return;
-
-       cursor_->move(x, y);
+       cursor_->setGeometry(x, y, x + 2, y - h);
        cursor_->shape_ = shape;
        cursor_->on_ = true;
        cursor_->show();
@@ -609,6 +608,8 @@ void GuiWorkArea::showCursor(int x, int y, int h, CursorShape shape)
 
 void GuiWorkArea::removeCursor()
 {
+       if (!qApp->focusWidget())
+               return;
        cursor_->hide();
 }
 
index 58a8fa635f220db8e56b9bfad090f4e70c174a90..61e10c5d4caf2b67115091a04855c863a2b49c6c 100644 (file)
@@ -806,6 +806,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                case LFUN_BUFFER_CLOSE:
                        closeBuffer();
+                       view()->update();
                        break;
 
                case LFUN_BUFFER_WRITE: