115 Commits

Author SHA1 Message Date
Nyall Dawson
e17b32c6e2 Fix moving/resizing grouped items 2017-10-09 19:23:46 +10:00
Nyall Dawson
606ad21a51 Port group actions from composer 2017-10-09 19:23:46 +10:00
Nyall Dawson
5aa9a1556f Start porting group handling from composer 2017-10-09 19:23:46 +10:00
Denis Rouzaud
6e14854f90 [sipify] remove redundant private sections 2017-10-09 09:51:40 +02:00
Nyall Dawson
0c858d27d6 Port display name handling from composer 2017-10-06 18:43:10 +10:00
Nyall Dawson
c8eaeb8f93 Port hide pages action from composer 2017-10-06 17:48:25 +10:00
Nyall Dawson
aa7beaad6a Port keyboard nudge of items from composer 2017-10-06 17:48:25 +10:00
Nyall Dawson
bb2e1efdb8 Create undo/redo commands when changing item visibility 2017-10-06 17:48:25 +10:00
Nyall Dawson
fd0cba3914 Hide most of QgsLayoutModel from stable API and remove from bindings
We only expose the QAbstractItemModel interface as stable API - the
rest is non-stable and subject to change.
2017-10-06 17:48:25 +10:00
Nyall Dawson
a66f2cb684 Nicer API for adding/removing items
Automatically create the corresponding undo commands, so that
plugins and scripts which add/delete items will be added to
the undo stack without any work required.
2017-10-06 17:48:25 +10:00
Nyall Dawson
c022bc825e [FEATURE][layouts] Add 'resize to square' action
Resizes all selected items so that they are square
2017-10-06 17:48:25 +10:00
Nyall Dawson
e686e2e565 Fix doxygen warning 2017-10-06 17:48:25 +10:00
Nyall Dawson
e3616f08c4 [FEATURE][layout] Add actions to auto resize items in a selection
Options are resize to narrowest, widest, shortest and tallest.
2017-10-06 17:48:25 +10:00
Nyall Dawson
5141c05ba7 [FEATURE][layout] Add item distribution actions
Adds actions for distributing selections of items by their
left/center/right/top/bottom edges.

Useful for quickly evenly distributing items in the layout

Needs new icons
2017-10-06 17:48:25 +10:00
Nyall Dawson
0939333273 Port item alignment to layouts 2017-10-06 17:48:25 +10:00
Nyall Dawson
822d6f76a3 Move actions which apply to selected items only to QgsLayoutView
Selections are a gui concept, so these actions belong to the
gui class instead of cluterring QgsLayout
2017-10-06 17:48:25 +10:00
Nyall Dawson
fdba8f199a Add tests for changing item z order 2017-10-06 17:48:25 +10:00
Nyall Dawson
e74a632002 Unfinished restore of stacking actions 2017-10-06 17:48:25 +10:00
Nyall Dawson
dbb31253e9 Resurrect locking/unlocking item actions 2017-10-06 17:48:25 +10:00
Nyall Dawson
683a8694e4 Correctly report selected status to items model 2017-10-06 17:48:25 +10:00
Nyall Dawson
62a5679230 Port item model from composer to layouts 2017-10-06 17:48:25 +10:00
Nyall Dawson
de9653044a Remove redundant custom enum (use Qt version instead) 2017-10-06 17:48:25 +10:00
Nyall Dawson
d65a18c5c0 Fix item snapping while resizing 2017-10-06 17:48:24 +10:00
Nyall Dawson
051ed1e156 Prevent snapping to selected items when resizing 2017-10-06 17:48:24 +10:00
Nyall Dawson
d950f17e75 Add item bounds based snapping to QgsLayoutSnapper 2017-10-06 17:48:24 +10:00
Nyall Dawson
bfa9c1d661 Port methods for retrieving item at a point to layouts 2017-10-06 17:48:24 +10:00
Nyall Dawson
2d6cbd6bba Restore ability to show/hide selection bounds 2017-10-06 17:48:24 +10:00
Nyall Dawson
207bcad626 Start porting mouse handles to layout 2017-10-06 17:48:24 +10:00
Nyall Dawson
7d072beee7 Add signals for size and rotation changes 2017-10-06 17:48:24 +10:00
Nyall Dawson
b5777adbdd Port some composer utils 2017-10-06 17:48:24 +10:00
Nyall Dawson
bb129516f8 Port selection handling code from composer 2017-10-06 17:48:24 +10:00
Nyall Dawson
51efa19f75 Port item frame related code from composer 2017-10-06 17:48:24 +10:00
Nyall Dawson
0b188295bc Port item selection and lock related code from composer 2017-10-06 17:48:24 +10:00
Nyall Dawson
4e61ea892a Port frame and background handling to layout items
And add support for frame widths with units
2017-10-06 17:48:24 +10:00
Nyall Dawson
a71f2ad5dc Fix non-virtual destructor 2017-09-25 12:46:49 +10:00
Nyall Dawson
b44cf5d10f Fix memory leak 2017-09-18 12:10:46 +10:00
Nyall Dawson
a77950cbf6 SIP, indentation and documentation updates 2017-09-05 09:53:48 +10:00
Nyall Dawson
62dcd0dad5 Start work on undo/redo support for layouts 2017-09-05 09:39:22 +10:00
Nyall Dawson
1589b4e648 Implement some saving/restoring layout items to XML 2017-09-05 09:39:22 +10:00
Nyall Dawson
66e1cf04e6 Port methods to retrieve layout items 2017-09-05 09:39:22 +10:00
Nyall Dawson
3fd2e0921d Fix ownership issue with layout guides 2017-08-07 22:31:44 +10:00
Nyall Dawson
94362fe218 Add signal when page is about to be deleted 2017-08-07 21:43:31 +10:00
Nyall Dawson
e453116101 [needs-docs] Refine snapping logic for layouts
Previously grids would always take precedence when both a grid
and guide were within tolerance of a point.

Now, guides will always take precedence - since they have been
manually set by users we make the assumption that they have
been explicitly placed at highly desirable snapping locations,
and should be selected over the general grid.

Additionally, grid snapping was previously only done if BOTH
x and y could be snapped to the grid. We now snap to the nearest
grid line for x/y separately. This means if a point is close
to a vertical grid line but not a horizontal one it will still
snap to that nearby vertical grid line.
2017-08-07 19:34:28 +10:00
Nyall Dawson
66875641a3 Hook up snap to guides menu option 2017-08-07 19:34:28 +10:00
Nyall Dawson
9267f8676c Readd menu option to show/hide guides 2017-08-07 19:34:28 +10:00
Nyall Dawson
98ff702491 [FEATURE] Add a button in guide manager to apply current page's guides
to all other pages

This allows resetting all other pages to use the guide configuration
for the current page. Since guides are now single page only (required
to handle mixed page size/orientation layouts), this is a shortcut
to allow guide configuration to be setup on a single page and then
easily transferred to all other pages in the layout.
2017-08-07 19:34:28 +10:00
Nyall Dawson
df3bcddab7 Hook up clearing guides 2017-08-07 19:34:28 +10:00
Nyall Dawson
da4382309e Allow deletion of guides by dragging outside of pages 2017-08-07 19:34:28 +10:00
Nyall Dawson
e06b0af91b Support dragging existing guides in rulers 2017-08-07 19:34:28 +10:00
Nyall Dawson
c6c9c6fabf Show guide positions in rulers 2017-08-07 19:34:28 +10:00