This QML plugin offers a reusable, C++ based framework to manage layout
of items (mainly plasmoids but other stuff too) inside Plasma Containments
This will replace the Javascript based plasmoid layout manager inside the
FolderView and Desktop containments (is planned also forPlasma mobile homescreen)
This makes folderview code simpler and layouting more reliable.
Relayouting behavior after screen resolution change improved too, making easier to
keep a similar looking layout
Details
- Reviewers
davidedmundson - Group Reviewers
Plasma - Commits
- R120:f59aecbcfec6: Introduce ContainmentLayoutManager QML plugin
Tested on FolderView, a minimal containment using it may be shipped on the store
if we don't feel to ship the folderview port immediately
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
- allow a limited auto expanding for applets
- click on empty areas always closes edit mode
- wire up maximum size
- start on a new logic for default sizes
- event comppress sizehints
- take minimum size into account
- new behavior for resize handles
- manage differently screen resize and other kind of resizes
- fix snapping on RTL and BTT positioning
Concept makes sense. I mostly like the layering and architecture, except for all the cases where we end up searching up the hierarchy to find objects. That doesn't seem like the best approach...not that I have anything much better.
I'm not finished, it's a big patch - but I thought I should submit what I have for now.
components/containmentlayoutmanager/abstractlayoutmanager.cpp | ||
---|---|---|
111 | setPosition setSize | |
components/containmentlayoutmanager/abstractlayoutmanager.h | ||
45 | I don't fully understand the split between AbstractLayoutManager and GridLayoutManager when AbstractLayoutManager effectively enforces a grid by having cell sizes. | |
components/containmentlayoutmanager/appletcontainer.cpp | ||
33 | How do we know this happens after the busy component is set? | |
components/containmentlayoutmanager/itemcontainer.cpp | ||
365 | scope this in the loop | |
371 | why? | |
376 | no point just wishing, we need to open a bug report at least | |
439 | why? We're above the minimum size, the user could have resized it smaller than this | |
components/containmentlayoutmanager/qml/private/BasicResizeHandle.qml | ||
27 | ResizeHandle2? | |
components/containmentlayoutmanager/resizehandle.cpp | ||
43 | we monitor the direct parent, but ConfigOverlay could be anywhere on the ancestory tree. |
- singal when can't resize
- make resize work with items that update hints while resizing
- use setPosition and setSize where possible
- make sure to connect to busy indicator
- don't try to assign space when the layout has an invalid size
- adress some comments
components/containmentlayoutmanager/abstractlayoutmanager.h | ||
---|---|---|
45 | in the end it needed cell sizes to be directly exposed to qml. | |
components/containmentlayoutmanager/itemcontainer.cpp | ||
371 | I may be wrong but I think if one would do QtObject {} } that internal object wouldn't be parented and stay dangling otherwise? | |
439 | This may be not necessary, depends the behavior we want. | |
components/containmentlayoutmanager/qml/private/BasicResizeHandle.qml | ||
27 | dead code of old prototypes | |
components/containmentlayoutmanager/resizehandle.cpp | ||
43 | This will catch it if the overlay is an ancestor.. monitoring every parent of parents and dynamically rebuilding the connection chain when one of them change, seems a bit.. overkill? |
components/containmentlayoutmanager/itemcontainer.cpp | ||
---|---|---|
371 | AFAIK, QML created objects don't use QObject parent. Instead there's a ref counting thing in the JS engine. | |
439 | If we want to use this in the panel/wherever we need ItemContainer to forward the full min/preferred/max sizes (with margins added) and have the LayoutManager be the one that takes this information and resizes the container. IMHO it shouldn't resize itself, it should just emit sizeHintChanged Then in AbstractLayoutManager we have a connect that does the current: releaseSpace(item) It then gives full absolute control to the manager, rather than it doing part and then the item doing part. |
components/containmentlayoutmanager/itemcontainer.cpp | ||
---|---|---|
439 | same code now moved in the layoutmanager |
components/containmentlayoutmanager/configoverlay.h | ||
---|---|---|
68 | Given ItemContainer instantiates this object (or a subclass therefore) can we make this public and call it from ItemContainer::setConfigOverlayVisible Then we get rid of one of the two searches through parents. |