mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
Show IBeam cursor instead of Cross while creating text markup annotations
This commit is contained in:
parent
39d44edbd7
commit
c64a6499e2
|
@ -11,6 +11,7 @@
|
|||
|
||||
// qt / kde includes
|
||||
#include <qcolor.h>
|
||||
#include <qcursor.h>
|
||||
#include <qevent.h>
|
||||
#include <qpainter.h>
|
||||
|
||||
|
@ -76,6 +77,11 @@ AnnotatorEngine::~AnnotatorEngine()
|
|||
{
|
||||
}
|
||||
|
||||
QCursor AnnotatorEngine::cursor() const
|
||||
{
|
||||
return Qt::CrossCursor;
|
||||
}
|
||||
|
||||
SmoothPath::SmoothPath( const QLinkedList<Okular::NormalizedPoint> &points, const QPen &pen )
|
||||
: points ( points ), pen ( pen )
|
||||
{
|
||||
|
|
|
@ -53,6 +53,8 @@ class AnnotatorEngine
|
|||
static void decodeEvent( const QMouseEvent * mouseEvent, EventType * eventType, Button * button );
|
||||
static void decodeEvent( const QTabletEvent * tabletEvent, EventType * eventType, Button * button );
|
||||
|
||||
virtual QCursor cursor() const;
|
||||
|
||||
protected:
|
||||
PageViewItem * item() { return m_item; }
|
||||
|
||||
|
|
|
@ -3657,7 +3657,7 @@ void PageView::updateCursor( const QPoint &p )
|
|||
if ( d->annotator && d->annotator->active() )
|
||||
{
|
||||
if ( pageItem || d->annotator->annotating() )
|
||||
setCursor( Qt::CrossCursor );
|
||||
setCursor( d->annotator->cursor() );
|
||||
else
|
||||
setCursor( Qt::ForbiddenCursor );
|
||||
}
|
||||
|
|
|
@ -630,6 +630,11 @@ class TextSelectorEngine : public AnnotatorEngine
|
|||
return QList< Okular::Annotation* >() << ann;
|
||||
}
|
||||
|
||||
QCursor cursor() const
|
||||
{
|
||||
return Qt::IBeamCursor;
|
||||
}
|
||||
|
||||
private:
|
||||
// data
|
||||
PageView * m_pageView;
|
||||
|
@ -777,6 +782,11 @@ bool PageViewAnnotator::annotating() const
|
|||
return active() && m_lockedItem;
|
||||
}
|
||||
|
||||
QCursor PageViewAnnotator::cursor() const
|
||||
{
|
||||
return m_engine->cursor();
|
||||
}
|
||||
|
||||
QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::EventType & eventType, const AnnotatorEngine::Button & button,
|
||||
const QPointF & pos, PageViewItem * item )
|
||||
{
|
||||
|
|
|
@ -70,6 +70,11 @@ class PageViewAnnotator : public QObject
|
|||
bool active() const;
|
||||
// @return Are we currently annotating (using the selected tool)?
|
||||
bool annotating() const;
|
||||
|
||||
// returns the preferred cursor for the current tool. call this only
|
||||
// if active() == true
|
||||
QCursor cursor() const;
|
||||
|
||||
QRect routeMouseEvent( QMouseEvent * event, PageViewItem * item );
|
||||
QRect routeTabletEvent( QTabletEvent * event, PageViewItem * item, const QPoint & localOriginInGlobal );
|
||||
QRect performRouteMouseOrTabletEvent( const AnnotatorEngine::EventType & eventType, const AnnotatorEngine::Button & button,
|
||||
|
|
Loading…
Reference in a new issue