Skip to content
Verified Commit 7840cb31 authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

OverlayZStacking: The ultimate QQC2.Popup stacking manager

This utility component provides popups with sane defaults for stacking
order, and ensures that children popups are never hidden behind parent.
Say no more to random magic numbers like 999999 (is that enough btw?).

The attached property recognizes all four sub-types of QQC2.Popup, so it
is not necessary to set layer on e.g. 3rd-party QQC2.Menu components.

Changing z index of a popup at runtime or even within aboutToShow
handler doesn't seem to be supported, so OverlayZStacking defers
emitting zChanged() signal until its attachee popup is closed.

Known limitations:

- Parent popup is searched through a parent chain starting from
  Popup::parent item, but parentChanged signals of said hierarchy are
  not observed. This can be fixed, if needed, by storing list of
  connections and reconnecting all on any change.
- QQC2 style implementations like qqc2-desktop-style and
  qqc2-breeze-style are expected to bind z index of relevant controls
  to Kirigami.OverlayZStacking.z property, otherwise attached objects
  won't be created.
- Drawers go below "full screen" overlays, so if an overlay is supposed
  to fully block the scene then it should also be modal, or else user
  would be able to interact with a non-visible drawer.
parent ce458836
Pipeline #478845 passed with stage
in 2 minutes and 38 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment