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
This commit is contained in:
Vincent van Ravesteijn 2010-10-24 22:14:31 +00:00
parent 0590c77d47
commit 1a9fe125f6
2 changed files with 14 additions and 2 deletions

View File

@ -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();
}

View File

@ -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_; }