aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets/qml/safearea
Commit message (Collapse)AuthorAgeFilesLines
* Make SafeArea.additionalMargins actually add to the margins, not unionTor Arne Vestbø2025-01-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The semantics of SafeArea.additionalMargins was initially to union the additional margins with the inherited margins, as this fit nicely with the case of adding margins for a header that lives in the non-safe area of the window. But for the case of a header that lives within the existing safe area, but wants to add additional margins for its container's children, the API was awkward, requiring the user to include the inherited margins explicitly. The name additionalMargins was also not correct given these semantics. We now follow the semantics of addition, which makes the use-case of a header that lives in the non-safe area a bit more explicit, but also clearer on exactly how much additional margins is added. The new semantics also match how AppKit/UIKit handles additional safe area insets, so the behavior should be familiar to anyone coming from those platforms. Pick-to: 6.9 Change-Id: I05e42e68da4237c0c7963457452ffea034ea3ae1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add SafeArea attached propertyTor Arne Vestbø2024-11-283-0/+106
The SafeArea attached type provides information about the areas of an Item or Window where content may risk being overlapped by other UI elements, such as system title bars or status bars. This information can be used to lay out children of an item within the safe area of the item, while still allowing a background color or effect to span the entire item. The attached type also provides a writable property to add additional margins, which are reflected through the item's and any children's safe area margins. This is useful for informing child items about elements such as headers or footers, that may overlap the other child items. Task-number: QTBUG-125373 Change-Id: Id83e384f31f9770367c98e6455ec44e1086beb8a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>