diff options
author | Mitch Curtis <[email protected]> | 2015-08-14 14:45:28 +0200 |
---|---|---|
committer | Mitch Curtis <[email protected]> | 2015-11-05 17:03:33 +0000 |
commit | 29f1e31c673123ce49c59f0feeea39f19a5707e7 (patch) | |
tree | c0b0a281db5c79a6b7b950e0fd2e52d284da832e /src | |
parent | a68b58a35aeafad279236d31c28acda02baff5cf (diff) |
Extras: fix DropShadow usage.
It's now recommended to use the samples property instead of radius.
The radius property is calculated for us based on the samples.
Task-number: QTBUG-47749
Change-Id: Ic29c91a1ca9961c74a6ad727ff7c9c671bf55929
Reviewed-by: Gunnar Sletta <[email protected]>
Reviewed-by: J-P Nurmi <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/Styles/Base/DelayButtonStyle.qml | 3 | ||||
-rw-r--r-- | src/controls/Styles/Base/PieMenuStyle.qml | 24 | ||||
-rw-r--r-- | src/controls/Styles/Base/StatusIndicatorStyle.qml | 8 | ||||
-rw-r--r-- | src/controls/Styles/Base/ToggleButtonStyle.qml | 4 | ||||
-rw-r--r-- | src/controls/Styles/Base/TumblerStyle.qml | 5 |
5 files changed, 22 insertions, 22 deletions
diff --git a/src/controls/Styles/Base/DelayButtonStyle.qml b/src/controls/Styles/Base/DelayButtonStyle.qml index 12f545bed..71e1c67da 100644 --- a/src/controls/Styles/Base/DelayButtonStyle.qml +++ b/src/controls/Styles/Base/DelayButtonStyle.qml @@ -191,11 +191,8 @@ CircularButtonStyle { DropShadow { id: progressBarDropShadow anchors.fill: progressBar - fast: true // QTBUG-33747 // cached: !control.pressed - radius: 4 - samples: radius * 2 color: progressBarDropShadowColor source: progressBar } diff --git a/src/controls/Styles/Base/PieMenuStyle.qml b/src/controls/Styles/Base/PieMenuStyle.qml index fdfa92e7e..6137cc91c 100644 --- a/src/controls/Styles/Base/PieMenuStyle.qml +++ b/src/controls/Styles/Base/PieMenuStyle.qml @@ -115,13 +115,25 @@ Style { /*! The selection color. */ property color selectionColor: "#eee" - /*! The shadow color. */ + /*! + The shadow color. + + \sa DropShadow + */ property color shadowColor: Qt.rgba(0, 0, 0, 0.26) - /*! The shadow radius. */ - property real shadowRadius: 50 + /*! + The shadow radius. - /*! The shadow spread. */ + \sa DropShadow + */ + property real shadowRadius: 10 + + /*! + The shadow spread. + + \sa DropShadow + */ property real shadowSpread: 0.3 /*! @@ -366,11 +378,9 @@ Style { DropShadow { id: dropShadow anchors.fill: itemgroup - fast: true - radius: shadowRadius spread: shadowSpread + samples: shadowRadius * 2 + 1 transparentBorder: true - samples: 12 color: shadowColor source: itemgroup } diff --git a/src/controls/Styles/Base/StatusIndicatorStyle.qml b/src/controls/Styles/Base/StatusIndicatorStyle.qml index 4366d1f72..bd539db3c 100644 --- a/src/controls/Styles/Base/StatusIndicatorStyle.qml +++ b/src/controls/Styles/Base/StatusIndicatorStyle.qml @@ -73,7 +73,6 @@ Style { property Component indicator: Item { readonly property real shineStep: 0.05 readonly property real smallestAxis: Math.min(control.width, control.height) - readonly property real shadowRadius: smallestAxis * 0.4 readonly property real outerRecessPercentage: 0.11 readonly property color offColor: Qt.rgba(0.13, 0.13, 0.13) readonly property color baseColor: control.active ? control.color : offColor @@ -113,12 +112,12 @@ Style { Item { id: shadowGuard anchors.fill: backgroundCanvas - anchors.margins: -shadowRadius + anchors.margins: -shadow.radius Canvas { id: colorCanvas anchors.fill: parent - anchors.margins: shadowRadius + anchors.margins: shadow.radius Connections { target: control @@ -144,9 +143,6 @@ Style { id: shadow source: shadowGuard color: control.color - // Don't set fast here because Qt < 5.3 will run into QTBUG-36931 - radius: shadowRadius - samples: Math.min(32, radius) cached: true anchors.fill: shadowGuard visible: control.active diff --git a/src/controls/Styles/Base/ToggleButtonStyle.qml b/src/controls/Styles/Base/ToggleButtonStyle.qml index ca1850122..64f1bb56e 100644 --- a/src/controls/Styles/Base/ToggleButtonStyle.qml +++ b/src/controls/Styles/Base/ToggleButtonStyle.qml @@ -249,8 +249,6 @@ CircularButtonStyle { id: uncheckedDropShadow anchors.fill: uncheckedCanvas cached: true - radius: 4 - samples: 8 color: uncheckedDropShadowColor source: uncheckedCanvas visible: !control.checked @@ -260,8 +258,6 @@ CircularButtonStyle { id: checkedDropShadow anchors.fill: checkedCanvas cached: true - radius: 4 - samples: 8 color: checkedDropShadowColor source: checkedCanvas visible: control.checked diff --git a/src/controls/Styles/Base/TumblerStyle.qml b/src/controls/Styles/Base/TumblerStyle.qml index 466055382..fd847e857 100644 --- a/src/controls/Styles/Base/TumblerStyle.qml +++ b/src/controls/Styles/Base/TumblerStyle.qml @@ -132,8 +132,9 @@ Style { DropShadow { anchors.fill: rect source: rect - radius: __padding - samples: Math.min(32, radius * 2) + samples: 15 + spread: 0.45 + cached: true } } |