diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-09-24 16:53:22 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-09-25 10:45:33 +0200 |
commit | 24eefa0bbb3fd3acd5277c8e8d0e39f4b3a12a72 (patch) | |
tree | 1d42340a609534277326966b6036f6d5ad60d874 | |
parent | 09cad0df0d2e13d966766c2f276e01e708be1950 (diff) |
NativeStyle: rename 'nativeBackground' to '__nativeBackground'
Since all properties that we add to the QML style files will
bleed into the API of the control, prepend '__' to
nativeBackground to mark it as private.
Change-Id: I0cb474e054c3a3824985cf39b4bb675fb57b0696
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/controls/macos/SpinBox.qml | 12 | ||||
-rw-r--r-- | src/imports/controls/windows/Button.qml | 12 | ||||
-rw-r--r-- | src/imports/controls/windows/SpinBox.qml | 12 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultButton.qml | 12 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultComboBox.qml | 22 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultDial.qml | 4 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultFrame.qml | 10 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultGroupBox.qml | 14 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultProgressBar.qml | 2 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultScrollBar.qml | 4 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultSlider.qml | 4 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultSpinBox.qml | 12 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultTextArea.qml | 12 | ||||
-rw-r--r-- | src/imports/nativestyle/controls/DefaultTextField.qml | 12 |
14 files changed, 70 insertions, 74 deletions
diff --git a/src/imports/controls/macos/SpinBox.qml b/src/imports/controls/macos/SpinBox.qml index 23083087..1eb7fa05 100644 --- a/src/imports/controls/macos/SpinBox.qml +++ b/src/imports/controls/macos/SpinBox.qml @@ -41,11 +41,11 @@ import QtQuick.NativeStyle as NativeStyle T.SpinBox { id: control - property bool nativeBackground: background instanceof NativeStyle.StyleItem + property bool __nativeBackground: background instanceof NativeStyle.StyleItem property bool nativeIndicators: up.indicator.hasOwnProperty("_qt_default") && down.indicator.hasOwnProperty("_qt_default") - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 90 /* minimum */ ) @@ -57,10 +57,10 @@ T.SpinBox { // Push the background right to make room for the indicators rightInset: nativeIndicators ? up.implicitIndicatorWidth + spacing : 0 - leftPadding: nativeBackground ? background.contentPadding.left: 0 - topPadding: nativeBackground ? background.contentPadding.top: 0 - rightPadding: (nativeBackground ? background.contentPadding.right : 0) + rightInset - bottomPadding: nativeBackground ? background.contentPadding.bottom: 0 + leftPadding: __nativeBackground ? background.contentPadding.left: 0 + topPadding: __nativeBackground ? background.contentPadding.top: 0 + rightPadding: (__nativeBackground ? background.contentPadding.right : 0) + rightInset + bottomPadding: __nativeBackground ? background.contentPadding.bottom: 0 validator: IntValidator { locale: control.locale.name diff --git a/src/imports/controls/windows/Button.qml b/src/imports/controls/windows/Button.qml index ce224eee..751cfb3f 100644 --- a/src/imports/controls/windows/Button.qml +++ b/src/imports/controls/windows/Button.qml @@ -42,7 +42,7 @@ import QtQuick.NativeStyle as NativeStyle T.Button { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem // Since QQuickControl will subtract the insets from the control size to // figure out the background size, we need to reverse that here, otherwise @@ -50,12 +50,12 @@ T.Button { implicitWidth: implicitBackgroundWidth + leftInset + rightInset implicitHeight: implicitBackgroundHeight + topInset + bottomInset - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - leftPadding: nativeBackground ? background.contentPadding.left : 5 - rightPadding: nativeBackground ? background.contentPadding.right : 5 - topPadding: nativeBackground ? background.contentPadding.top : 5 - bottomPadding: nativeBackground ? background.contentPadding.bottom : 5 + leftPadding: __nativeBackground ? background.contentPadding.left : 5 + rightPadding: __nativeBackground ? background.contentPadding.right : 5 + topPadding: __nativeBackground ? background.contentPadding.top : 5 + bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5 background: NativeStyle.Button { control: control diff --git a/src/imports/controls/windows/SpinBox.qml b/src/imports/controls/windows/SpinBox.qml index c8914691..e891aaf4 100644 --- a/src/imports/controls/windows/SpinBox.qml +++ b/src/imports/controls/windows/SpinBox.qml @@ -42,11 +42,11 @@ import QtQuick.NativeStyle as NativeStyle T.SpinBox { id: control - property bool nativeBackground: background instanceof NativeStyle.StyleItem + property bool __nativeBackground: background instanceof NativeStyle.StyleItem property bool nativeIndicators: up.indicator.hasOwnProperty("_qt_default") && down.indicator.hasOwnProperty("_qt_default") - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined implicitWidth: implicitBackgroundWidth + leftInset + rightInset implicitHeight: Math.max(implicitBackgroundHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight) @@ -57,10 +57,10 @@ T.SpinBox { // Push the background right to make room for the indicators rightInset: nativeIndicators ? up.implicitIndicatorWidth + spacing : 0 - leftPadding: nativeBackground ? background.contentPadding.left: 0 - topPadding: nativeBackground ? background.contentPadding.top: 0 - rightPadding: (nativeBackground ? background.contentPadding.right : 0) + rightInset - bottomPadding: nativeBackground ? background.contentPadding.bottom: 0 + leftPadding: __nativeBackground ? background.contentPadding.left: 0 + topPadding: __nativeBackground ? background.contentPadding.top: 0 + rightPadding: (__nativeBackground ? background.contentPadding.right : 0) + rightInset + bottomPadding: __nativeBackground ? background.contentPadding.bottom: 0 validator: IntValidator { locale: control.locale.name diff --git a/src/imports/nativestyle/controls/DefaultButton.qml b/src/imports/nativestyle/controls/DefaultButton.qml index de0c8b70..7e55aaa2 100644 --- a/src/imports/nativestyle/controls/DefaultButton.qml +++ b/src/imports/nativestyle/controls/DefaultButton.qml @@ -43,7 +43,7 @@ import QtQuick.NativeStyle as NativeStyle T.Button { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem // Since QQuickControl will subtract the insets from the control size to // figure out the background size, we need to reverse that here, otherwise @@ -51,12 +51,12 @@ T.Button { implicitWidth: implicitBackgroundWidth + leftInset + rightInset implicitHeight: implicitBackgroundHeight + topInset + bottomInset - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - leftPadding: nativeBackground ? background.contentPadding.left : 5 - rightPadding: nativeBackground ? background.contentPadding.right : 5 - topPadding: nativeBackground ? background.contentPadding.top : 5 - bottomPadding: nativeBackground ? background.contentPadding.bottom : 5 + leftPadding: __nativeBackground ? background.contentPadding.left : 5 + rightPadding: __nativeBackground ? background.contentPadding.right : 5 + topPadding: __nativeBackground ? background.contentPadding.top : 5 + bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5 background: NativeStyle.Button { control: control diff --git a/src/imports/nativestyle/controls/DefaultComboBox.qml b/src/imports/nativestyle/controls/DefaultComboBox.qml index 91726921..6992c597 100644 --- a/src/imports/nativestyle/controls/DefaultComboBox.qml +++ b/src/imports/nativestyle/controls/DefaultComboBox.qml @@ -44,7 +44,7 @@ import QtQuick.NativeStyle as NativeStyle T.ComboBox { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding, @@ -53,17 +53,17 @@ T.ComboBox { implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - leftPadding: nativeBackground ? background.contentPadding.left : 5 - rightPadding: nativeBackground ? background.contentPadding.right : 5 - topPadding: nativeBackground ? background.contentPadding.top : 5 - bottomPadding: nativeBackground ? background.contentPadding.bottom : 5 + leftPadding: __nativeBackground ? background.contentPadding.left : 5 + rightPadding: __nativeBackground ? background.contentPadding.right : 5 + topPadding: __nativeBackground ? background.contentPadding.top : 5 + bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5 - topInset: nativeBackground ? background.insets.top : 0 - bottomInset: nativeBackground ? background.insets.bottom : 0 - leftInset: nativeBackground ? background.insets.left : 0 - rightInset: nativeBackground ? background.insets.right : 0 + topInset: __nativeBackground ? background.insets.top : 0 + bottomInset: __nativeBackground ? background.insets.bottom : 0 + leftInset: __nativeBackground ? background.insets.left : 0 + rightInset: __nativeBackground ? background.insets.right : 0 contentItem: T.TextField { implicitWidth: contentWidth @@ -101,7 +101,7 @@ T.ComboBox { } popup: T.Popup { - readonly property var layoutMargins: control.nativeBackground ? control.background.layoutMargins : null + readonly property var layoutMargins: control.__nativeBackground ? control.background.layoutMargins : null x: layoutMargins ? layoutMargins.left : 0 y: control.height - (layoutMargins ? layoutMargins.bottom : 0) width: control.width - (layoutMargins ? layoutMargins.left + layoutMargins.right : 0) diff --git a/src/imports/nativestyle/controls/DefaultDial.qml b/src/imports/nativestyle/controls/DefaultDial.qml index 42cc1271..b628ed09 100644 --- a/src/imports/nativestyle/controls/DefaultDial.qml +++ b/src/imports/nativestyle/controls/DefaultDial.qml @@ -42,7 +42,7 @@ import QtQuick.NativeStyle as NativeStyle T.Dial { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding, @@ -51,7 +51,7 @@ T.Dial { implicitContentHeight + topPadding + bottomPadding, 80 /* minimum */ ) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined background: NativeStyle.Dial { control: control diff --git a/src/imports/nativestyle/controls/DefaultFrame.qml b/src/imports/nativestyle/controls/DefaultFrame.qml index 6241a91e..77ca6125 100644 --- a/src/imports/nativestyle/controls/DefaultFrame.qml +++ b/src/imports/nativestyle/controls/DefaultFrame.qml @@ -42,17 +42,17 @@ import QtQuick.NativeStyle as NativeStyle T.Frame { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) - leftPadding: nativeBackground ? background.contentPadding.left : 12 - rightPadding: nativeBackground ? background.contentPadding.right : 12 - topPadding: nativeBackground ? background.contentPadding.top : 12 - bottomPadding: nativeBackground ? background.contentPadding.bottom : 12 + leftPadding: __nativeBackground ? background.contentPadding.left : 12 + rightPadding: __nativeBackground ? background.contentPadding.right : 12 + topPadding: __nativeBackground ? background.contentPadding.top : 12 + bottomPadding: __nativeBackground ? background.contentPadding.bottom : 12 background: NativeStyle.Frame { control: control diff --git a/src/imports/nativestyle/controls/DefaultGroupBox.qml b/src/imports/nativestyle/controls/DefaultGroupBox.qml index 37d0254d..07c587cb 100644 --- a/src/imports/nativestyle/controls/DefaultGroupBox.qml +++ b/src/imports/nativestyle/controls/DefaultGroupBox.qml @@ -42,7 +42,7 @@ import QtQuick.NativeStyle as NativeStyle T.GroupBox { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding, @@ -50,11 +50,11 @@ T.GroupBox { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined label: Rectangle { color: control.palette.window - property point labelPos : control.nativeBackground + property point labelPos : control.__nativeBackground ? background.labelPos : Qt.point(0,0) x: labelPos.x + background.x @@ -72,10 +72,10 @@ T.GroupBox { } } - leftPadding: nativeBackground ? background.contentPadding.left : 0 - rightPadding: nativeBackground ? background.contentPadding.right : 0 - topPadding: nativeBackground ? background.contentPadding.top : 0 - bottomPadding: nativeBackground ? background.contentPadding.bottom : 0 + leftPadding: __nativeBackground ? background.contentPadding.left : 0 + rightPadding: __nativeBackground ? background.contentPadding.right : 0 + topPadding: __nativeBackground ? background.contentPadding.top : 0 + bottomPadding: __nativeBackground ? background.contentPadding.bottom : 0 background: NativeStyle.GroupBox { control: control diff --git a/src/imports/nativestyle/controls/DefaultProgressBar.qml b/src/imports/nativestyle/controls/DefaultProgressBar.qml index 80b0b94a..290387c5 100644 --- a/src/imports/nativestyle/controls/DefaultProgressBar.qml +++ b/src/imports/nativestyle/controls/DefaultProgressBar.qml @@ -42,7 +42,7 @@ import QtQuick.NativeStyle as NativeStyle T.ProgressBar { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding, diff --git a/src/imports/nativestyle/controls/DefaultScrollBar.qml b/src/imports/nativestyle/controls/DefaultScrollBar.qml index 0f42bc80..0e1b74dd 100644 --- a/src/imports/nativestyle/controls/DefaultScrollBar.qml +++ b/src/imports/nativestyle/controls/DefaultScrollBar.qml @@ -42,14 +42,14 @@ import QtQuick.NativeStyle as NativeStyle T.ScrollBar { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined visible: policy === T.ScrollBar.AlwaysOn || (active && size < 1.0) diff --git a/src/imports/nativestyle/controls/DefaultSlider.qml b/src/imports/nativestyle/controls/DefaultSlider.qml index 02459497..ebc1c265 100644 --- a/src/imports/nativestyle/controls/DefaultSlider.qml +++ b/src/imports/nativestyle/controls/DefaultSlider.qml @@ -42,7 +42,7 @@ import QtQuick.NativeStyle as NativeStyle T.Slider { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitHandleWidth + leftPadding + rightPadding, @@ -51,7 +51,7 @@ T.Slider { implicitHandleHeight + topPadding + bottomPadding, control.vertical ? 90 : 0 /* minimum */ ) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined background: NativeStyle.Slider { control: control diff --git a/src/imports/nativestyle/controls/DefaultSpinBox.qml b/src/imports/nativestyle/controls/DefaultSpinBox.qml index 100ccf6a..869ff411 100644 --- a/src/imports/nativestyle/controls/DefaultSpinBox.qml +++ b/src/imports/nativestyle/controls/DefaultSpinBox.qml @@ -42,7 +42,7 @@ import QtQuick.NativeStyle as NativeStyle T.SpinBox { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(implicitBackgroundWidth + spacing + up.implicitIndicatorWidth + leftInset + rightInset, @@ -50,14 +50,14 @@ T.SpinBox { implicitHeight: Math.max(implicitBackgroundHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight + (spacing * 3)) + topInset + bottomInset - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined spacing: 2 - leftPadding: (nativeBackground ? background.contentPadding.left: 0) - topPadding: (nativeBackground ? background.contentPadding.top: 0) - rightPadding: (nativeBackground ? background.contentPadding.right : 0) + up.implicitIndicatorWidth + spacing - bottomPadding: (nativeBackground ? background.contentPadding.bottom: 0) + spacing + leftPadding: (__nativeBackground ? background.contentPadding.left: 0) + topPadding: (__nativeBackground ? background.contentPadding.top: 0) + rightPadding: (__nativeBackground ? background.contentPadding.right : 0) + up.implicitIndicatorWidth + spacing + bottomPadding: (__nativeBackground ? background.contentPadding.bottom: 0) + spacing validator: IntValidator { locale: control.locale.name diff --git a/src/imports/nativestyle/controls/DefaultTextArea.qml b/src/imports/nativestyle/controls/DefaultTextArea.qml index 819e32ad..5a72b91a 100644 --- a/src/imports/nativestyle/controls/DefaultTextArea.qml +++ b/src/imports/nativestyle/controls/DefaultTextArea.qml @@ -43,8 +43,6 @@ import QtQuick.NativeStyle as NativeStyle T.TextArea { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem - implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, implicitBackgroundWidth + leftInset + rightInset, placeholder.implicitWidth + leftPadding + rightPadding) @@ -52,12 +50,10 @@ T.TextArea { implicitBackgroundHeight + topInset + bottomInset, placeholder.implicitHeight + topPadding + bottomPadding) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined - - leftPadding: nativeBackground ? background.contentPadding.left : 7 - rightPadding: nativeBackground ? background.contentPadding.right : 7 - topPadding: nativeBackground ? background.contentPadding.top : 3 - bottomPadding: nativeBackground ? background.contentPadding.bottom + 5: 3 + leftPadding: 7 + rightPadding: 7 + topPadding: 3 + bottomPadding: 3 color: control.palette.text selectionColor: control.palette.highlight diff --git a/src/imports/nativestyle/controls/DefaultTextField.qml b/src/imports/nativestyle/controls/DefaultTextField.qml index 63489627..d8bee337 100644 --- a/src/imports/nativestyle/controls/DefaultTextField.qml +++ b/src/imports/nativestyle/controls/DefaultTextField.qml @@ -43,7 +43,7 @@ import QtQuick.NativeStyle as NativeStyle T.TextField { id: control - readonly property bool nativeBackground: background instanceof NativeStyle.StyleItem + readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem implicitWidth: Math.max(Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding, implicitBackgroundWidth + leftInset + rightInset, @@ -52,12 +52,12 @@ T.TextField { contentHeight + topPadding + bottomPadding, placeholder.implicitHeight + topPadding + bottomPadding) - font.pixelSize: nativeBackground ? background.styleFont(control).pixelSize : undefined + font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - leftPadding: nativeBackground ? background.contentPadding.left: 7 - rightPadding: nativeBackground ? background.contentPadding.right: 7 - topPadding: nativeBackground ? background.contentPadding.top: 3 - bottomPadding: nativeBackground ? background.contentPadding.bottom: 3 + leftPadding: __nativeBackground ? background.contentPadding.left: 7 + rightPadding: __nativeBackground ? background.contentPadding.right: 7 + topPadding: __nativeBackground ? background.contentPadding.top: 3 + bottomPadding: __nativeBackground ? background.contentPadding.bottom: 3 color: control.palette.text selectionColor: control.palette.highlight |