42231 Commits

Author SHA1 Message Date
Nyall Dawson
ee0e9ff5a1 Fix undo/redo crash with temporary test item 2017-10-06 18:32:17 +10:00
Nyall Dawson
83f035e63c Indentation 2017-10-06 17:48:25 +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
9c8b96be39 Call base class undo commands 2017-10-06 17:48:25 +10:00
Nyall Dawson
66b4bdf01d Fix invalid merge of non equal item commands 2017-10-06 17:48:25 +10:00
Nyall Dawson
88a7f02c77 Port preview modes from composer 2017-10-06 17:48:25 +10:00
Nyall Dawson
b04c10115b Fix items are removed from scene twice 2017-10-06 17:48:25 +10:00
Nyall Dawson
5796b899fc Fix build when model test is enabled 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
3e933dcda8 Add undo/redo commands when toggling lock through items panel 2017-10-06 17:48:25 +10:00
Nyall Dawson
afd9d23a21 Fix size of columns in items dock on hidpi screens 2017-10-06 17:48:25 +10:00
Nyall Dawson
1d622e5a2a Add new icon for resize to square (thanks @nirvn) 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
4167724035 Even more explicit naming 2017-10-06 17:48:25 +10:00
Nyall Dawson
f3bfcc3182 Save/restore frame properties, add unit tests for undo/redo 2017-10-06 17:48:25 +10:00
Nyall Dawson
616aec1566 Save/restore a few more layout item properties 2017-10-06 17:48:25 +10:00
Nyall Dawson
80e0e07202 Correctly create undo commands for item addition and removal 2017-10-06 17:48:25 +10:00
Nyall Dawson
cac08f93eb Nicer menu naming 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
73077c4ef3 Use new icons 2017-10-06 17:48:25 +10:00
nirvn
3cd5f72f6f [layout] add distribute and resize action icons 2017-10-06 17:48:25 +10:00
Nyall Dawson
e686e2e565 Fix doxygen warning 2017-10-06 17:48:25 +10:00
Nyall Dawson
95a76eeef8 Port delete action - TODO: undo/redo 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
c5fcc9da69 Unit tests for alignment 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
c6da276783 Add more unit tests 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
833cb60f1f Port toggle panel action to layouts 2017-10-06 17:48:25 +10:00
Nyall Dawson
02831024a6 Restore items dock 2017-10-06 17:48:25 +10:00
Nyall Dawson
4cba2b90ef Port select next above/below 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
b494a71feb Port selection actions to layout 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
639ecd1748 Correctly handle item focusing in layout designer 2017-10-06 17:48:25 +10:00
Nyall Dawson
e172356b87 Fix orphan snap lines sometimes show 2017-10-06 17:48:24 +10:00
Nyall Dawson
1e7149e1e3 Select new items after adding them 2017-10-06 17:48:24 +10:00
Nyall Dawson
9ae9624261 Ensure that snap lines show for whole layout 2017-10-06 17:48:24 +10:00
Nyall Dawson
d65a18c5c0 Fix item snapping while resizing 2017-10-06 17:48:24 +10:00
Nyall Dawson
628936771a Nicer mouse handle alignment behaviour
Don't show horizontal/vertical align snap lines if the resize
isn't allowing resizing in that axis
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
d8ffab1523 [FEATURE][layouts] Snapping to item bounds when creating new items
Previously snapping to item bounds would only occur when resizing
or moving items, now it also applies to item creation
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