X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiWorkArea.cpp;h=ef79b02fe3e1c7b0f76ef3e8b53cbf8866bbe2af;hb=8b7584846c4e1a9c87a004fab479722fee7e3013;hp=0c1eeed670db8e63f50cd20fdabc0100da47ca3d;hpb=d0feccc7ed4025f6348644b3a91be757e10ced77;p=lyx.git diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 0c1eeed670..ef79b02fe3 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; @@ -434,6 +443,7 @@ void GuiWorkArea::redraw(bool update_metrics) if (update_metrics || lyx_view_ != guiApp->currentView() || lyx_view_->currentWorkArea() != this) { // FIXME: it would be nice to optimize for the off-screen case. + buffer_view_->cursor().fixIfBroken(); buffer_view_->updateMetrics(); buffer_view_->cursor().fixIfBroken(); } @@ -458,6 +468,8 @@ void GuiWorkArea::redraw(bool update_metrics) buffer_view_->coordCache().dump(); setReadOnly(buffer_view_->buffer().isReadonly()); + + updateCursorShape(); } @@ -527,6 +539,8 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod) // Show the cursor immediately after any operation startBlinkingCursor(); } + + updateCursorShape(); }