diff options
author | Doris Verria <[email protected]> | 2025-03-19 17:00:47 +0100 |
---|---|---|
committer | Doris Verria <[email protected]> | 2025-03-20 17:47:22 +0000 |
commit | e26b0ab97b0c02dbe9d32c496a54835c64bc2b3b (patch) | |
tree | 4793e179834d591e1b76723235bd542f7d7a71f4 | |
parent | 39f6b9fb2a0b434e14a820a74de244163964659a (diff) |
iOS Style: Hide private properties
The style declares many dynamic properties that are meant to be
private and not available eg: from code completion. Use __ to hide them.
Pick-to: 6.9 6.8
Change-Id: Idf132a71cacad6ddff951bc378101f1d094112f5
Reviewed-by: Richard Moe Gustavsen <[email protected]>
-rw-r--r-- | src/quickcontrols/ios/ComboBox.qml | 28 | ||||
-rw-r--r-- | src/quickcontrols/ios/DialogButtonBox.qml | 20 | ||||
-rw-r--r-- | src/quickcontrols/ios/Drawer.qml | 17 | ||||
-rw-r--r-- | src/quickcontrols/ios/MenuItem.qml | 22 |
4 files changed, 46 insertions, 41 deletions
diff --git a/src/quickcontrols/ios/ComboBox.qml b/src/quickcontrols/ios/ComboBox.qml index 7ddbfbf348..bac201728b 100644 --- a/src/quickcontrols/ios/ComboBox.qml +++ b/src/quickcontrols/ios/ComboBox.qml @@ -17,10 +17,10 @@ T.ComboBox { implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding) - readonly property bool popupButtonStyle: control.flat && !control.editable + readonly property bool __popupButtonStyle: control.flat && !control.editable - spacing: popupButtonStyle ? 6 : 12 - padding: popupButtonStyle ? 0 : 12 + spacing: __popupButtonStyle ? 6 : 12 + padding: __popupButtonStyle ? 0 : 12 topPadding: 0 bottomPadding: 0 leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) @@ -66,11 +66,11 @@ T.ComboBox { indicator: ColorImage { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 - rotation: control.popupButtonStyle ? 0 : 90 - opacity: (control.enabled || control.popupButtonStyle) ? 1 : 0.5 + rotation: control.__popupButtonStyle ? 0 : 90 + opacity: (control.enabled || control.__popupButtonStyle) ? 1 : 0.5 - source: IOS.url + (control.popupButtonStyle ? "arrow-updown-indicator" : "arrow-indicator") - color: control.popupButtonStyle ? (control.down ? control.palette.highlight : control.palette.button) + source: IOS.url + (control.__popupButtonStyle ? "arrow-updown-indicator" : "arrow-indicator") + color: control.__popupButtonStyle ? (control.down ? control.palette.highlight : control.palette.button) : defaultColor ImageSelector on source { states: [ @@ -82,11 +82,11 @@ T.ComboBox { } contentItem: T.TextField { - implicitWidth: control.popupButtonStyle ? Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitWidth: control.__popupButtonStyle ? Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) : 0 - implicitHeight: control.popupButtonStyle ? Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHeight: control.__popupButtonStyle ? Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) : 0 - padding: control.popupButtonStyle ? 0 : 6 + padding: control.__popupButtonStyle ? 0 : 6 text: control.editable ? control.editText : control.displayText enabled: control.editable autoScroll: control.editable @@ -95,7 +95,7 @@ T.ComboBox { validator: control.validator selectByMouse: control.selectTextByMouse - color: control.popupButtonStyle ? (control.down ? control.palette.highlight : control.palette.button) + color: control.__popupButtonStyle ? (control.down ? control.palette.highlight : control.palette.button) : control.palette.text selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText @@ -105,11 +105,11 @@ T.ComboBox { } background: Rectangle { - implicitWidth: control.popupButtonStyle ? implicitContentWidth : 250 + implicitWidth: control.__popupButtonStyle ? implicitContentWidth : 250 implicitHeight: 34 radius: 4 color: control.palette.base - visible: !control.popupButtonStyle + visible: !control.__popupButtonStyle } popup: T.Popup { @@ -117,7 +117,7 @@ T.ComboBox { y: control.height + 6 height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) - width: control.popupButtonStyle ? 250 : control.width + width: control.__popupButtonStyle ? 250 : control.width topMargin: 6 bottomMargin: 6 diff --git a/src/quickcontrols/ios/DialogButtonBox.qml b/src/quickcontrols/ios/DialogButtonBox.qml index abffea1596..eb041da0ac 100644 --- a/src/quickcontrols/ios/DialogButtonBox.qml +++ b/src/quickcontrols/ios/DialogButtonBox.qml @@ -14,16 +14,18 @@ T.DialogButtonBox { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - readonly property var orientation: (count === 2 || alignment !== 0) - ? ListView.Horizontal : ListView.Vertical - readonly property bool delegatePressed: count === 2 && (itemAt(0).down || itemAt(1).down) + readonly property var __orientation: (count === 2 || alignment !== 0) + ? ListView.Horizontal + : ListView.Vertical + readonly property bool __delegatePressed: count === 2 && (itemAt(0).down || itemAt(1).down) - spacing: orientation === ListView.Horizontal - ? (background && background.separatorLine ? background.separatorLine.width : 0) + spacing: __orientation === ListView.Horizontal + ? (background && background.separatorLine + ? background.separatorLine.width : 0) : 0 delegate: DialogButtonBoxDelegate { - width: control.orientation === ListView.Vertical + width: control.__orientation === ListView.Vertical ? control.width : undefined } @@ -33,13 +35,13 @@ T.DialogButtonBox { implicitHeight: contentHeight model: control.contentModel spacing: control.spacing - orientation: control.orientation + orientation: control.__orientation boundsBehavior: Flickable.StopAtBounds snapMode: ListView.SnapToItem } background: Item { - implicitHeight: control.orientation === ListView.Horizontal ? 44 : Math.max(contentItem.implicitHeight, 44) + implicitHeight: control.__orientation === ListView.Horizontal ? 44 : Math.max(control.contentItem.implicitHeight, 44) implicitWidth: 270 readonly property NinePatchImage backgroundImage : NinePatchImage { @@ -62,7 +64,7 @@ T.DialogButtonBox { x: control.itemAt(0) ? control.itemAt(0).width : 0 height: parent.height rotation: control.position === DialogButtonBox.Header ? 180 : 0 - visible: control.alignment === 0 && (control.count === 2 && !control.delegatePressed) + visible: control.alignment === 0 && (control.count === 2 && !control.__delegatePressed) source: IOS.url + "dialogbuttonbox-separator" NinePatchImageSelector on source { diff --git a/src/quickcontrols/ios/Drawer.qml b/src/quickcontrols/ios/Drawer.qml index f6b35be43e..b50abf67c6 100644 --- a/src/quickcontrols/ios/Drawer.qml +++ b/src/quickcontrols/ios/Drawer.qml @@ -16,7 +16,7 @@ T.Drawer { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - property real inset: control.dim ? 8 : 0 + property real __inset: control.dim ? 8 : 0 property bool vertical: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge topPadding: SafeArea.margins.top @@ -24,10 +24,10 @@ T.Drawer { rightPadding: SafeArea.margins.right bottomPadding: SafeArea.margins.bottom - rightInset: background && control.edge === Qt.LeftEdge ? -inset : 0 - leftInset: background && control.edge === Qt.RightEdge ? -inset : 0 - bottomInset: background && control.edge === Qt.TopEdge ? -inset : 0 - topInset: background && control.edge === Qt.BottomEdge ? -inset : 0 + rightInset: background && control.edge === Qt.LeftEdge ? -__inset : 0 + leftInset: background && control.edge === Qt.RightEdge ? -__inset : 0 + bottomInset: background && control.edge === Qt.TopEdge ? -__inset : 0 + topInset: background && control.edge === Qt.BottomEdge ? -__inset : 0 enter: Transition { SmoothedAnimation { velocity: 5 } } exit: Transition { SmoothedAnimation { velocity: 5 } } @@ -53,8 +53,11 @@ T.Drawer { width: vertical ? 1 : parent.width height: vertical ? parent.height : 1 color: control.palette.mid - x: control.edge === Qt.LeftEdge ? parent.width - 1 - inset : (control.edge === Qt.RightEdge ? inset : 0) - y: control.edge === Qt.BottomEdge ? inset : (control.edge === Qt.TopEdge ? parent.height - 1 - inset : 0) + x: control.edge === Qt.LeftEdge ? parent.width - 1 - control.__inset + : (control.edge === Qt.RightEdge ? control.__inset : 0) + y: control.edge === Qt.BottomEdge ? control.__inset + : (control.edge === Qt.TopEdge + ? parent.height - 1 - control.__inset : 0) z: 10 } } diff --git a/src/quickcontrols/ios/MenuItem.qml b/src/quickcontrols/ios/MenuItem.qml index 46aba80187..ff2e3cfddb 100644 --- a/src/quickcontrols/ios/MenuItem.qml +++ b/src/quickcontrols/ios/MenuItem.qml @@ -25,13 +25,13 @@ T.MenuItem { icon.height: 19 icon.color: control.palette.text - readonly property bool isSingleItem: control.menu && control.menu.count === 1 - readonly property bool isFirstItem: !isSingleItem && control.menu && control.menu.itemAt(0) === control ? true : false - readonly property bool isLastItem: !isSingleItem && control.menu && control.menu.itemAt(control.menu.count - 1) === control ? true : false - readonly property real indicatorWidth: 12 + readonly property bool __isSingleItem: control.menu && control.menu.count === 1 + readonly property bool __isFirstItem: !__isSingleItem && control.menu && control.menu.itemAt(0) === control ? true : false + readonly property bool __isLastItem: !__isSingleItem && control.menu && control.menu.itemAt(control.menu.count - 1) === control ? true : false + readonly property real __indicatorWidth: 12 contentItem: IconLabel { - readonly property real padding: control.indicatorWidth + control.spacing + readonly property real padding: control.__indicatorWidth + control.spacing leftPadding: !control.mirrored ? padding : 0 rightPadding: control.mirrored ? padding : 0 @@ -76,16 +76,16 @@ T.MenuItem { implicitHeight: 44 implicitWidth: 250 NinePatchImage { - y: control.isLastItem ? -1 : 0 + y: control.__isLastItem ? -1 : 0 width: parent.width - height: control.isLastItem ? parent.height + 1 : parent.height - rotation: control.isLastItem ? 180 : 0 - visible: !(isSingleItem && !control.down) + height: control.__isLastItem ? parent.height + 1 : parent.height + rotation: control.__isLastItem ? 180 : 0 + visible: !(control.__isSingleItem && !control.down) source: IOS.url + "menuitem-background" NinePatchImageSelector on source { states: [ - {"edge": control.isFirstItem || control.isLastItem}, - {"single": control.isSingleItem}, + {"edge": control.__isFirstItem || control.__isLastItem}, + {"single": control.__isSingleItem}, {"light": Application.styleHints.colorScheme === Qt.Light}, {"dark": Application.styleHints.colorScheme === Qt.Dark}, {"pressed": control.down} |