Allen Winter
b4f49895c2
clarify: licensing is GPL2 or GPL3 or commercial licensed
...
follow the REUSE specs
2020-07-24 18:16:13 -04:00
Sergio Martins
2994046c7b
Fix -Wclazy-rule-of-three
2020-06-23 17:48:40 +01:00
Allen Winter
7773c3fe27
minor spelling fixes
2020-06-23 11:10:56 -04:00
Sergio Martins
6bbcb8f8f2
Rename LayoutSaver::MultiSplitterLayout to LayoutSaver::MultiSplitter
2020-06-11 17:00:54 +01:00
Sergio Martins
c9fa637ae7
Add some helper methods to LayoutSaver::Layout
...
To retrieve the list of main windows and dock widgets present
in the loaded layout
2020-05-26 18:29:30 +01:00
Sergio Martins
d94263fce5
Allow each dock widget and main window to support multiple affinities
2020-05-25 14:14:17 +01:00
Sergio Martins
f260a76f8b
Rename LastPosition to Position
...
so we can have a list of them, the dock widget might have been
in several main windows
2020-05-21 14:49:49 +01:00
Sergio Martins
97c1ca30fd
Layouting engine rewrite
...
The layouting was becoming too complex to maintain and to introduce
new features. Was even buggy, the fuzzer was constantly finding
bugs, which took hours to workaround.
Problem with the old layout engine is that there was a catch 22, between
Items driving the separators, and separators driving the anchors.
The new layout is much simpler, both in implementation and conceptually.
There's simply a recursive hierarchy of Item elements. An Item can either
have a QWidget to show, or be a ItemContainer, which contains Item children,
and so forth. Each ItemContainer is either vertical or horizontal. That's enough
to represent the "nested multi-splitter" concept which KDDW uses.
After each item insertion/deletion/resize, the separators are regenerated. They
are essentially dumb now.
TODO:
- Separators are drawn, but are not interactive yet
- There's 5 tests failing
- LayoutSaver scalling functionality
2020-05-04 00:02:03 +01:00
Sergio Martins
5b91021745
LayoutSaver: insert the DockWidget ptr into the cash
2020-03-01 15:03:07 +00:00
Sergio Martins
dedda6cb14
LayoutSaver: Also store the affinity in the JSON
2020-03-01 14:13:02 +00:00
Sergio Martins
ce6fd20efd
LayoutSaver: Also restore position percentage
...
Fixes anchors going to weird places when the window is resized.
Calculated percentage was wrong because layout hadn't been deserialized
yet.
2020-02-26 23:31:59 +00:00
Sergio Martins
af5bb4a3e4
Also store the percentage position in the json
...
just for checking that the restore is sane, even though
that property is calculated at runtime
2020-02-26 22:45:40 +00:00
Sergio Martins
564a7091e1
LayoutSaver: Fix off-by-ones case with relative-restoring
...
If the window didn't change size nothing should happen
2020-02-25 20:00:46 +00:00
Sergio Martins
ca211f2494
LayoutSaver: Add an option to restore in relative sizes
...
and not touching the main window geometry.
The option is not exposed yet, there's a layouting bug to fix first.
2020-02-25 19:06:43 +00:00
Sergio Martins
435e61288e
LayoutSaver: Remove the QDataStream serializer
...
Keep only the deserializer, for now, so we can convert old layouts
to json.
2020-02-24 15:22:44 +00:00
Sergio Martins
5b0eb93cda
LayoutSaver: Add a json to/from methods
...
Still not being used by public api though.
2020-02-24 14:45:06 +00:00
Sergio Martins
69ada1bdad
LayoutSaver: Add to/from variant map methods
...
To make it easy to use json instead of QDataStream
2020-02-23 22:55:30 +00:00
Sergio Martins
950ef943b7
LayoutSaver: Save the top-levels screen number
...
So we can be smarter when restoring layouts with different screen
setups
2020-02-20 18:39:06 +00:00
Sergio Martins
b0525ed1f1
LayoutSaver: Save the list of screens and their properties
...
So we can be smarter when restoring on different screen setups
2020-02-20 17:50:28 +00:00
Sergio Martins
e7661cca91
LayoutSaver: serialize/deserialize the screenSize and layoutSize too
2020-02-20 15:41:00 +00:00
Sergio Martins
efdd8f9f81
LayoutSaver: Also store the screen and layout size
...
So when restoring we can restore relative to that
2020-02-20 14:14:06 +00:00
Sergio Martins
6338e6b03e
Fix my Werror clang build
2020-01-29 15:17:01 +00:00
Allen Winter
df692686e7
various - update copyright year
2020-01-07 11:36:56 -05:00
Sergio Martins
c80a16d2c1
Also use the intermediate representation when serializing
2019-09-21 15:15:44 +01:00
Sergio Martins
65c9693a62
Restoring now reads from the intermediate representation
...
Only the intermediate representation is filled in from the stream
now. TODO: GUI->intermediate.
2019-09-20 17:24:22 +01:00
Sergio Martins
778402896d
Fix build on Windows
2019-09-11 11:22:02 +01:00
Sergio Martins
cde4bd9bbd
LayoutSaver: Add more validation
2019-09-10 19:19:22 +01:00
Sergio Martins
5a3727deae
LayoutSaver: Also validate anchors upper bound
2019-09-10 19:03:49 +01:00
Sergio Martins
d38221f52c
minor rename
2019-09-10 18:53:43 +01:00
Sergio Martins
a348274bc4
Add LayoutSaver::Layout::isValid()
2019-09-10 18:52:33 +01:00
Sergio Martins
21afb04555
Use LayoutSaver::DockWidget by pointer
...
As we're changing it's shared and we're changing its members.
This way the members changes everywhere, as there's only 1 instance
of each dock widget
2019-09-10 17:21:09 +01:00
Sergio Martins
b2c9acc2f5
Fix a serialization mistkae
...
now matches how it was before
2019-09-10 16:52:09 +01:00
Sergio Martins
5448c9655e
Introduce an intermediate serialization format for save/restore
...
QDataStream is opaque and is not good for validation.
With this intermediate format we'll be able to:
- manipulate stuff
- validate that the saved layout is correct, before restoring it
- decide about some restore heuristics which would have been impossible
because before we needed to restore as we read the stream, now we can
look at the state before restoring it
LayoutSaver isn't using the new format yet, but the LayoutSaver::Layout
is already useful to debug some bogus saved states
2019-09-10 16:24:14 +01:00