Behaves like old kddockwidgets now.
When dragging a separator, only the immediate neighbours are resized.
Only when min-sizes are violated that it propagates.
to be used when dragging separators when mouse, as we don't want
a recursive resize dealing with percentages, as it doesn't need to be fair.
Items near the mouse/separator will suffer/benetif more from there resize.
Resize only propagates further when size-constraints come into action
After restoring, we need to put the layout at the same size
as its widget. Most of the times this happens since we also restore
the widget's geometry. But really make sure, as something might happen
to the window geometry, like for example using RestoreOption_RelativeToMainWindow
which doesn't restore the main window geometries
and use it for calculating the min/max position of a separator
The min/max position of a separator isn't local to its container,
but is recursive upwards until root
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
When the maximize is triggered by Qt, we get the WM_GETMINMAXINFO
too soon, as QWindow already says it's maximized, while it's still
in process of being.
Just removed the condition, doesn't seem to have any bad side-effect
As happens with other docking frameworks:
- Maximized/restore button only visible when window is floating
- floating button is never visible
Available by setting Flag_TitleBarHasMaximizeButton.
Added example too.
Fixes: #37
Fixes leak reported by LSAN:
```
#0 0x7f7b5687e968 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:104
#1 0x7f7b2e5b1096 in KDDockWidgets::TabBarWidget::TabBarWidget(KDDockWidgets::TabWidget*) ../3rdParty/kddockwidgets/src/private/widgets/TabBarWidget.cpp:71
#2 0x7f7b2e295ba4 in KDDockWidgets::DefaultWidgetFactory::createTabBar(KDDockWidgets::TabWidget*) const ../3rdParty/kddockwidgets/src/FrameworkWidgetFactory.cpp:71
#3 0x7f7b2e5b8f54 in KDDockWidgets::TabWidgetWidget::TabWidgetWidget(KDDockWidgets::Frame*) ../3rdParty/kddockwidgets/src/private/widgets/TabWidgetWidget.cpp:38
```
The owernship rules for QProxyStyle <-> QStyle are pure madness.
We do not want to delete the proxy we use as a base. And we must
not ever create multiple proxy styles for the same style either.
So add a static singleton for the proxy style and set its parent
to the qApp. This seems to work fine, at least the leak is gone
and we also don't get a crash at shutdown...