From 1a9fe125f64bff3251d70cbd18c851259267cc28 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 24 Oct 2010 22:14:31 +0000 Subject: [PATCH] Update the cursor shape also when the cursor shape changes without a mouse move actions. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35808 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 14 ++++++++++++-- src/frontends/qt4/GuiWorkArea.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 667dd6f4fa..b6480ffb11 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -325,11 +325,20 @@ Qt::CursorShape GuiWorkArea::cursorShape() const return viewport()->cursor().shape(); } + void GuiWorkArea::setCursorShape(Qt::CursorShape shape) { viewport()->setCursor(shape); } + +void GuiWorkArea::updateCursorShape() +{ + setCursorShape(buffer_view_->clickableInset() + ? Qt::PointingHandCursor : Qt::IBeamCursor); +} + + void GuiWorkArea::setGuiView(GuiView & gv) { lyx_view_ = &gv; @@ -458,6 +467,8 @@ void GuiWorkArea::redraw(bool update_metrics) buffer_view_->coordCache().dump(); setReadOnly(buffer_view_->buffer().isReadonly()); + + updateCursorShape(); } @@ -528,8 +539,7 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod) startBlinkingCursor(); } - setCursorShape(buffer_view_->clickableInset() - ? Qt::PointingHandCursor : Qt::IBeamCursor); + updateCursorShape(); } diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index a0fcf73786..34725ed424 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -142,6 +142,8 @@ public: Qt::CursorShape cursorShape() const; void setCursorShape(Qt::CursorShape shape); + /// Change the cursor when the mouse hovers over a clickable inset + void updateCursorShape(); /// Return the GuiView this workArea belongs to GuiView const & view() const { return *lyx_view_; } -- 2.39.2