Remove dead code
Since the Windows nativestyle SpinBox never uses a NativeStyle.SpinBox as a background, there is no need in having the bool __nativeBackground property (the background is always an Item). We can then remove/simplify all code that uses the __nativeBackground property, since it was already always false before this change. Also removes this warning: SpinBox.qml:15:5: Unable to assign [undefined] to int Pick-to: 6.4 6.2 Change-Id: I2b9e44617884ba4523fbe17417aaccc432c1cb50 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
52fcfdf73d
commit
c353609e1a
|
@ -8,12 +8,9 @@ import QtQuick.NativeStyle as NativeStyle
|
|||
T.SpinBox {
|
||||
id: control
|
||||
|
||||
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
|
||||
|
||||
implicitWidth: Math.max(contentItem.implicitWidth + leftInset + rightInset,
|
||||
90 /* minimum */ )
|
||||
implicitHeight: Math.max(contentItem.implicitHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight)
|
||||
|
@ -21,10 +18,10 @@ T.SpinBox {
|
|||
|
||||
spacing: 2
|
||||
|
||||
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: 0
|
||||
topPadding: 0
|
||||
rightPadding: rightInset
|
||||
bottomPadding: 0
|
||||
|
||||
validator: IntValidator {
|
||||
locale: control.locale.name
|
||||
|
|
Loading…
Reference in New Issue