@@ -26,6 +26,7 @@ Item {
26 property bool itemFocused: false
26 property bool itemFocused: false
27 property real maxAngle: 0
27 property real maxAngle: 0
28 property bool inverted: false
28 property bool inverted: false
29+ property bool clipCorner: false
30 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
31 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
31 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
32 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
@@ -143,6 +144,24 @@ Item {
149+ anchors.centerIn: parent
150+ width: iconItem.width
151+ height: iconItem.height
155+ topMargin: -units.gu(2)
156+ leftMargin: -units.gu(2)
157+ rightMargin: -units.gu(2)
158+ bottomMargin: units.gu(1.2)
161+ rotation: root.rotation + 45
146 ShaderEffect {
165 ShaderEffect {
147 id: transformEffect
166 id: transformEffect
148 anchors.centerIn: parent
167 anchors.centerIn: parent
@@ -152,6 +171,7 @@ Item {
152 property real itemOpacity: root.itemOpacity
171 property real itemOpacity: root.itemOpacity
153 property real brightness: Math.max(-1, root.brightness)
172 property real brightness: Math.max(-1, root.brightness)
154 property real angle: root.angle
173 property real angle: root.angle
174+ property bool clipCorner: root.clipCorner
155 rotation: root.inverted ? 180 : 0
175 rotation: root.inverted ? 180 : 0
157 property variant source: ShaderEffectSource {
177 property variant source: ShaderEffectSource {
@@ -160,6 +180,11 @@ Item {
160 hideSource: true
180 hideSource: true
183+ property var mask: ShaderEffectSource {
163 transform: [
188 transform: [
164 // Rotating 3 times at top/bottom because that increases the perspective.
189 // Rotating 3 times at top/bottom because that increases the perspective.
165 // This is a hack, but as QML does not support real 3D coordinates
190 // This is a hack, but as QML does not support real 3D coordinates
@@ -194,13 +219,19 @@ Item {
194 fragmentShader: "
219 fragmentShader: "
195 varying highp vec2 qt_TexCoord0;
220 varying highp vec2 qt_TexCoord0;
196 uniform sampler2D source;
221 uniform sampler2D source;
222+ uniform sampler2D mask;
197 uniform lowp float brightness;
223 uniform lowp float brightness;
198 uniform lowp float itemOpacity;
224 uniform lowp float itemOpacity;
225+ uniform bool clipCorner;
199 void main(void)
226 void main(void)
201 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
228 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
229+ highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
202 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
230 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
203 sourceColor *= itemOpacity;
231 sourceColor *= itemOpacity;
233+ sourceColor *= maskColor.a;
204 gl_FragColor = sourceColor;
235 gl_FragColor = sourceColor;