@@ -15,7 +15,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18−import Ubuntu.Components 0.1 as Theming
18+import Ubuntu.Components 0.1
20/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
20/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
21 * general (Item-based) components. This ability should be incorporated into the SDK's
21 * general (Item-based) components. This ability should be incorporated into the SDK's
@@ -24,66 +24,22 @@ import Ubuntu.Components 0.1 as Theming
27− id: shape
27+ id: root
29− Theming.ItemStyle.class: "UbuntuShape-radius-" + radius
29+ property alias radius: shape.radius
30+ property alias image: source.sourceItem
31− property string radius: "small"
32+ ShaderEffectSource {
32− property url maskSource: Theming.ComponentUtils.style(shape, "maskSource", "")
33− property url borderSource: Theming.ComponentUtils.style(shape, "borderIdle", "")
36− implicitWidth: units.gu(8)
37− implicitHeight: units.gu(8)
39− onWidthChanged: __updateImageDimensions()
40− onHeightChanged: __updateImageDimensions()
41− onImageChanged: __updateImageDimensions()
43− function __updateImageDimensions() {
45− image.width = shape.width;
46− image.height = shape.height;
47− image.visible = false;
54− property ShaderEffectSource mask: ShaderEffectSource {
55− sourceItem: BorderImage {
58− source: shape.maskSource
33+ id: source
59− visible: false
34+ width: 1
61− }
36+ hideSource: true
63− property ShaderEffectSource image: ShaderEffectSource {
64− sourceItem: shape.image
69− varying highp vec2 qt_TexCoord0;
70− uniform lowp float qt_Opacity;
71− uniform sampler2D mask;
72− uniform sampler2D image;
76− lowp vec4 maskColor = texture2D(mask, qt_TexCoord0.st);
77− lowp vec4 imageColor = texture2D(image, qt_TexCoord0.st);
78− gl_FragColor = imageColor * maskColor.a * qt_Opacity;
83− BorderImage {
39+ Shape {
84− id: border
40+ id: shape
86 anchors.fill: parent
43 anchors.fill: parent
87− source: shape.borderSource