@@ -27,6 +27,7 @@ Item {
27 property bool itemFocused: false
27 property bool itemFocused: false
28 property real maxAngle: 0
28 property real maxAngle: 0
29 property bool inverted: false
29 property bool inverted: false
30+ property bool clipCorner: false
31 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
32 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
32 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
33 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
@@ -150,6 +151,22 @@ Item {
156+ anchors.fill: parent
160+ topMargin: -units.gu(2)
161+ leftMargin: -units.gu(2)
162+ rightMargin: -units.gu(2)
163+ bottomMargin: units.gu(1)
166+ rotation: root.rotation + 45
153 ShaderEffect {
170 ShaderEffect {
154 id: transformEffect
171 id: transformEffect
155 anchors.centerIn: parent
172 anchors.centerIn: parent
@@ -159,6 +176,7 @@ Item {
159 property real itemOpacity: root.itemOpacity
176 property real itemOpacity: root.itemOpacity
160 property real brightness: Math.max(-1, root.brightness)
177 property real brightness: Math.max(-1, root.brightness)
161 property real angle: root.angle
178 property real angle: root.angle
179+ property bool clipCorner: root.clipCorner
162 rotation: root.inverted ? 180 : 0
180 rotation: root.inverted ? 180 : 0
164 property variant source: ShaderEffectSource {
182 property variant source: ShaderEffectSource {
@@ -168,6 +186,11 @@ Item {
168 live: false
186 live: false
189+ property var mask: ShaderEffectSource {
171 transform: [
194 transform: [
172 // Rotating 3 times at top/bottom because that increases the perspective.
195 // Rotating 3 times at top/bottom because that increases the perspective.
173 // This is a hack, but as QML does not support real 3D coordinates
196 // This is a hack, but as QML does not support real 3D coordinates
@@ -202,13 +225,19 @@ Item {
202 fragmentShader: "
225 fragmentShader: "
203 varying highp vec2 qt_TexCoord0;
226 varying highp vec2 qt_TexCoord0;
204 uniform sampler2D source;
227 uniform sampler2D source;
228+ uniform sampler2D mask;
205 uniform lowp float brightness;
229 uniform lowp float brightness;
206 uniform lowp float itemOpacity;
230 uniform lowp float itemOpacity;
231+ uniform bool clipCorner;
207 void main(void)
232 void main(void)
209 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
234 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
235+ highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
210 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
236 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
211 sourceColor *= itemOpacity;
237 sourceColor *= itemOpacity;
239+ sourceColor *= maskColor.a;
212 gl_FragColor = sourceColor;
241 gl_FragColor = sourceColor;