16 Commits

Author SHA1 Message Date
Nyall Dawson
cdec70babe [needs-docs] Add a new item properties dialog
When adding a new item to a layout, if the user just does a single
click of the mouse (vs a click and drag to set the new item
position/size), then a dialog is shown asking to user for
the new item size/position/reference point.

This allows easy creation of items with an exact position/size
and is common behavior in most proper DTP/illustration apps.
2017-07-18 12:42:06 +10:00
Nyall Dawson
28cd9addab Restore rulers in layout designer 2017-07-11 14:21:35 +10:00
Nyall Dawson
cf488d34a4 Split layout item registry into two separate registries
Instead of relying on forward declared c++ classes from
gui in QgsLayoutItemRegistry, instead create a
QgsLayoutItemGuiRegistry which handles registration
of all the GUI specific behavior relating to layout items.

Remove all GUI related code from QgsLayoutItemRegistry.

This creates a cleaner split between core/gui code, and
given that there'll be a lot of gui specific behavior
which needs to be handled by a registry it makes sense
to keep this isolated in gui.

It also plays nicer with the sip bindings, which can't
handle forward declared gui classes in core.
2017-07-11 11:06:36 +10:00
Nyall Dawson
0307cac325 Port ability to pan layouts with middle mouse button depressed 2017-07-11 11:06:36 +10:00
Nyall Dawson
b9bbd91754 Port ability to navigate layouts using space-pan and ctrl-space zoom 2017-07-11 11:06:36 +10:00
Nyall Dawson
4065a7ff67 Add shell for non-functional layout select tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
41b98aa23c Add layout zoom tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
3f66520828 Add layout panning tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
3843b5ef37 Create rubber band classes for layout views
c++ QgsLayoutItem metadata classes can directly register
a function which creates a QgsLayoutViewRubberBand for the item
subclass.

Python code cannot utilise this shortcut (due to inaccessibility
of forward declared gui classes from core Python classes), so
there's a separate gui registry utility class added for registering
prototypes for rubber bands for already registered item types.
2017-07-11 11:06:36 +10:00
Nyall Dawson
4ebea75e6a Subclass QMouseEvent to QgsLayoutViewMouseEvent
For easy access to mouse event coordinates in layout coordinate
space (and future use with snapped item coordinates)
2017-07-11 11:06:35 +10:00
Nyall Dawson
a6ccd63bc8 Start implementing an add item tool 2017-07-11 11:06:35 +10:00
Nyall Dawson
99f34300b9 Add shell classes for layout view tools
Copy the same model as QgsMapCanvas uses, with separate
classes for individual interaction tools instead of keeping
all the logic in the QGraphicsView subclass (as is done
with composer)
2017-07-11 11:06:35 +10:00
Nyall Dawson
4c2447fd89 Add shell for QgsLayoutView 2017-07-11 11:06:35 +10:00
Nyall Dawson
0b9fb5d6e1 [needs-docs] New gui widget QgsFontButton
A standard widget for configuring text format properties for use
with QgsTextRenderer/QgsTextFormat.

It's modelled heavily off QgsColorButton, and supports lots of nice
things like dragging formats between buttons, copying and pasting
format settings, dropping colors from color buttons, dragging colors
from font buttons to color buttons, directly setting font size
and opacity/color without having to open a dialog.
2017-07-06 19:56:39 +10:00
Nyall Dawson
4f21afac0f Shell layout designer dialog 2017-07-03 12:14:56 +10:00
Denis Rouzaud
54c6291378 script to write include SIP files 2017-06-28 10:45:51 +02:00