diff options
author | Javier <dev.git@javispedro.com> | 2020-09-12 02:21:04 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2020-09-12 02:21:04 +0200 |
commit | c2eca928c5a7be0444fcb5c41ffe77b557714575 (patch) | |
tree | af7d2ed9e2b018a4ea95329bb944853f41cf088f /pageitem.cc | |
parent | 20de09ffbaa00ab3adf91e49b847eb0061315b1e (diff) | |
download | scribiu-c2eca928c5a7be0444fcb5c41ffe77b557714575.tar.gz scribiu-c2eca928c5a7be0444fcb5c41ffe77b557714575.zip |
when zooming out, place pages on a grid layout
Diffstat (limited to 'pageitem.cc')
-rw-r--r-- | pageitem.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pageitem.cc b/pageitem.cc index b5be4cf..9260ecd 100644 --- a/pageitem.cc +++ b/pageitem.cc @@ -18,6 +18,8 @@ #include <QtCore/QDebug> #include <QtGui/QPen> +#include <QtWidgets/QGraphicsSceneMouseEvent> +#include "notebookview.h" #include "pageitem.h" #include "stfgraphicsitem.h" @@ -65,6 +67,17 @@ int PageItem::pageNum() const return _pageNum; } +void PageItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) +{ + QGraphicsView *view = scene()->views().first(); + if (NotebookView *nbview = qobject_cast<NotebookView*>(view)) { + nbview->focusOnPage(_pageNum); + event->accept(); + return; + } + QGraphicsItem::mouseDoubleClickEvent(event); +} + void PageItem::createStrokes() { QStringList pens = _nb->penSerials(); |