Draft: general: Use AdwDualPaneView and AdwAdaptiveState

Closed Christopher Davis requested to merge wip/cdavis/dual-pane-adaptive-states into main

AdwLeaflet and friends cause undefined behavior by making changes to widget size while the widget is in the process of being resized. This causes applications to emit warnings and criticals in the process of resizing, and in order to not exacerbate the issue we end up limited in what we can do at different sizes.

AdwAdaptiveState is a new utility that developers attach to their top-level windows. The object has set horizontal and vertical breakpoints, and can set properties on other objects when a breakpoint is reached. You can also listen to the enter and exit breakpoints to make arbitrary changes in code.

AdwDualPaneView is a replacement for Leaflet that expects developers to use adaptive states to manage whether or not it is folded. AdwDualPaneView makes use of another new widget, AdwBrowsingView, that manages pages like a Leaflet would with can-unfold=false. It connects two browsing views together - these views are either provided by the application developer or are transparently created by libadwaita.

Widgets like Leaflet are likely to be deprecated in the future, and apps are expected to move to adaptive states, browsing views, and dual pane views. This merge request ports Fractal to AdwDualPaneView and AdwAdaptiveState, dropping AdwLeaflet.

Merge request reports