aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/macos/MenuItem.qml
Commit message (Collapse)AuthorAgeFilesLines
* QQuickMenuItem: add implicitTextPadding and textPaddingRichard Moe Gustavsen2024-05-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the properties "implicitTextPadding" and "textPadding" to MenuItem. They can be used by the style to ensure that all MenuItems inside the same Menu end up left-aligned WRT text. Each MenuItem should set implicitTextPadding to be the needed space from the left edge of the contentItem to the text label. QQuickMenu will then iterate over all the MenuItems inside the same Menu, and set textPadding to be the maximum implicitTextPadding found. All MenuItems should then use textPadding (which will end up the same for all MenuItems) to position the text. This API is meant to solve the problem that MenuItems inside a single Menu can have different contents. Some can be checkable, some can have an icon, some are just plain text. And for several of our styles (e.g macOS and Windows), we want the text to be left-aligned regardless of that. Without this API, The checkmark inside a checkable MenuItem would be left-aligned with the text inside a plain MenuItem etc. [ChangeLog][Controls][MenuItem] A MenuItem now has two new properties (implicitTextPadding and textPadding) that can be used for aligning the text across all MenuItems inside a Menu. Change-Id: I1f2248b31c63d6b9780d8fc77229a8b902362f70 Reviewed-by: Oliver Eftevaag <[email protected]>
* macos style: add CheckIndicatorRichard Moe Gustavsen2024-04-291-1/+1
| | | | | | | | | | | | | The macOS style is currently falling back to use a CheckIndicator from the Fusion style. This doesn't look very native on macOS. This patch will therefore implement the missing CheckIndicator for the macOS style, and try to make it look as native as possible. Change-Id: I4c0a56de3972a92e4e3791852c043f08a2006eb1 Reviewed-by: Mitch Curtis <[email protected]>
* macos style: Add Menu and MenuBar controlsRichard Moe Gustavsen2024-04-291-0/+74
The macOS style is currently falling back to use a MenuBar, MenuBarItem, MenuSeparator etc from the Fusion style. This doesn't look very native on macOS. This patch will therefore implement the missing MenuBar controls for the macOS style, and try to make them look as native as possible. Change-Id: I84f16b7765ec42504eb70a31eb0f649f3d2ecdcc Reviewed-by: Mitch Curtis <[email protected]>