summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-14 14:45:28 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-11-05 17:03:33 +0000
commit29f1e31c673123ce49c59f0feeea39f19a5707e7 (patch)
treec0b0a281db5c79a6b7b950e0fd2e52d284da832e
parenta68b58a35aeafad279236d31c28acda02baff5cf (diff)
downloadqtquickcontrols-29f1e31c673123ce49c59f0feeea39f19a5707e7.tar.gz
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 <gunnar@sletta.org> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/controls/Styles/Base/DelayButtonStyle.qml3
-rw-r--r--src/controls/Styles/Base/PieMenuStyle.qml24
-rw-r--r--src/controls/Styles/Base/StatusIndicatorStyle.qml8
-rw-r--r--src/controls/Styles/Base/ToggleButtonStyle.qml4
-rw-r--r--src/controls/Styles/Base/TumblerStyle.qml5
5 files changed, 22 insertions, 22 deletions
diff --git a/src/controls/Styles/Base/DelayButtonStyle.qml b/src/controls/Styles/Base/DelayButtonStyle.qml
index 12f545be..71e1c67d 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 fdfa92e7..6137cc91 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 4366d1f7..bd539db3 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 ca185012..64f1bb56 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 46605538..fd847e85 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
}
}