45 Commits

Author SHA1 Message Date
Nyall Dawson
df3bcddab7 Hook up clearing guides 2017-08-07 19:34:28 +10:00
Nyall Dawson
ab726c4777 Add methods to determine visible pages in a view 2017-08-07 19:34:28 +10:00
Nyall Dawson
886a1208ef Dropping guides outside of pages doesn't create new guides 2017-08-07 19:34:28 +10:00
Nyall Dawson
b0956c9bd7 [needs-docs] Partial WIP of dragging rulers to create guide lines
Unlike in 2.x, Layouts in 3.0 adopt the standard UX of dragging
out rulers to create guide lines (instead of clicking on a ruler
position to create a guide)
2017-08-07 19:34:28 +10:00
Nyall Dawson
ef6727518d [FEATURE] Add a dock widget showing snap guides for current page
Allows creation of snap lines at specific locations, and
adjusting position of existing guides to exact coordinates
2017-08-07 19:34:28 +10:00
Nyall Dawson
798ec83681 Start on snapping marker 2017-08-07 19:34:28 +10:00
Nyall Dawson
f57212eee5 Hook up snapping for QgsLayoutViewTools
Tools can now indicate (via setFlags()) if they desire snapping
to be active for the tool. When a tool has the flag set,
any QgsLayoutViewMouseEvents it receives will have a snappedPoint()
available which returns the mouse event point snapped using
the layout's snapping settings.
2017-08-07 19:34:28 +10:00
Nyall Dawson
20029c2956 Add a lot of framework code for showing item properties in designer
And hook up a non-functional page properties widget which is
shown when right clicking on a page in the view.
2017-07-25 12:54:58 +10:00
Nyall Dawson
0f90e23fe6 Refine item widget creation methods in layout item gui registry 2017-07-25 12:54:58 +10:00
Nyall Dawson
72bf2924d4 Port base class for item configuration widgets 2017-07-25 12:54:58 +10:00
Nyall Dawson
f1dfd3dbe2 Add an interface for creation of QgsLayoutView context menus
Allows display of custom right click menus when right click
events are not handled by the current layout view tool.
2017-07-25 12:54:58 +10:00
Nyall Dawson
416e1e4bbf Fix drawing of rulers with multipage layouts 2017-07-25 12:54:57 +10:00
Nyall Dawson
3021fc86d2 QgsLayoutUnitComboBox can be linked to spin boxes so that their
values are automatically updated when the combo box unit changes

This means that you can flip between units and things like
the existing width and height are converted immediately to the
new unit
2017-07-25 12:54:57 +10:00
Nyall Dawson
7f066672b3 Add method to specify item groups for item classes in QgsLayoutItemGuiRegistry
This allows the designer dialog to group the corresponding item
actions together (i.e. grouping all basic shape creation actions
together), but without any hardcoded special handling so that
plugin based items can also be grouped.
2017-07-18 12:42:06 +10:00
Nyall Dawson
de2626d65c Add unit types to new item properties dialog, handle different reference
point settings
2017-07-18 12:42:06 +10:00
Nyall Dawson
d14f3b9c13 Add QComboBox subclass widget for selecting layout units 2017-07-18 12:42:06 +10:00
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
b4f5025d4f Port shape items to layouts 2017-07-18 12:42:06 +10:00
Nyall Dawson
1b93cdae71 Spelling update 2017-07-11 14:24:14 +10:00
Nyall Dawson
28cd9addab Restore rulers in layout designer 2017-07-11 14:21:35 +10:00
Nyall Dawson
c25aab16b0 Port display of cursor location from composer 2017-07-11 12:57:38 +10:00
Nyall Dawson
02d0a046f8 Add some shortcuts to zoom to layout/layout width in status bar combobox 2017-07-11 12:23:30 +10:00
Nyall Dawson
e27a32d41c Add status bar zoom control to layout designer 2017-07-11 11:48:22 +10:00
Nyall Dawson
ac83093570 Port zoom actions from composer to layout designer 2017-07-11 11:06:36 +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
20ca51b59c Port ability to wheel zoom into/out of layout designer 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
dc0425abee Update cursor on alt press/release for zoom tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
7974597c08 Add a zoom tool to designer dialog 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
867bdb6117 Move click-and-drag detection to QgsLayoutViewTool 2017-07-11 11:06:36 +10:00
Nyall Dawson
5cac2f71f0 Allow setting pen/brush for QgsLayoutViewRubberBand 2017-07-11 11:06:36 +10:00
Nyall Dawson
a346736df2 Handle tool changes mid press-release operation
Because it's possible for users to change the tool while a
press release operation is mid-way, e.g. by pressing a tool
shortcut key.
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
db62a745eb Add a temporary layout item type for testing 2017-07-11 11:06:36 +10:00
Nyall Dawson
86bc8af216 Add some unit tests 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
25034979e3 Add some unit tests for layout tools 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
4f21afac0f Shell layout designer dialog 2017-07-03 12:14:56 +10:00