@@ -25,6 +25,7 @@ Item {
25 property real angle: 0
25 property real angle: 0
26 property bool highlighted: false
26 property bool highlighted: false
27 property real offset: 0
27 property real offset: 0
28+ property alias brightness: transformEffect.brightness
29 property real maxAngle: 0
30 property real maxAngle: 0
30 property bool inverted: false
31 property bool inverted: false
@@ -37,31 +38,18 @@ Item {
38 property bool dragging:false
39 property bool dragging:false
40−// property real brightness: 0
41− property alias brightness: brightnessEffect.brightness
43 signal clicked()
41 signal clicked()
44 signal longtap()
42 signal longtap()
45 signal released()
43 signal released()
47− onYChanged: print("y is", y)
49 UbuntuShape {
45 UbuntuShape {
50 id: iconItem
46 id: iconItem
51 color: Qt.rgba(0, 0, 1, 0.5)
47 color: Qt.rgba(0, 0, 1, 0.5)
52 width: parent.width
48 width: parent.width
53 height: parent.height
49 height: parent.height
54 anchors.centerIn: parent
50 anchors.centerIn: parent
55− anchors.verticalCenterOffset: root.offset + (height - root.effectiveHeight)/2 * (angle < 0 ? 1 : -1)
56− rotation: root.inverted ? 180 : 0
57 radius: "medium"
51 radius: "medium"
59− transform: Rotation {
60− axis { x: 1; y: 0; z: 0 }
61− origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
65 image: Image {
53 image: Image {
66 id: iconImage
54 id: iconImage
67 source: "../graphics/applicationIcons/" + root.iconName + ".png"
55 source: "../graphics/applicationIcons/" + root.iconName + ".png"
@@ -90,31 +78,17 @@ Item {
90 width: iconItem.width + units.gu(1.5)
78 width: iconItem.width + units.gu(1.5)
91 height: width
79 height: width
94−/* BrightnessContrast {
104− anchors.fill: parent
110 ShaderEffect {
83 ShaderEffect {
111− id: brightnessEffect
84+ id: transformEffect
112 anchors.centerIn: parent
85 anchors.centerIn: parent
113 width: parent.width
86 width: parent.width
114 height: parent.height
87 height: parent.height
115 property real itemOpacity: root.opacity
88 property real itemOpacity: root.opacity
116 property real brightness: 0
89 property real brightness: 0
117 property real angle: root.angle
90 property real angle: root.angle
91+ rotation: root.inverted ? 180 : 0
119 anchors.verticalCenterOffset: root.offset + (height - root.effectiveHeight)/2 * (angle < 0 ? 1 : -1)
93 anchors.verticalCenterOffset: root.offset + (height - root.effectiveHeight)/2 * (angle < 0 ? 1 : -1)
@@ -122,6 +96,13 @@ Item {
122 sourceItem: iconItem
96 sourceItem: iconItem
123 hideSource: true
97 hideSource: true
100+ transform: Rotation {
101+ axis { x: 1; y: 0; z: 0 }
102+ origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
125/* vertexShader: "
106/* vertexShader: "
126 uniform highp mat4 qt_Matrix;
107 uniform highp mat4 qt_Matrix;
127 attribute highp vec4 qt_Vertex;
108 attribute highp vec4 qt_Vertex;
@@ -147,12 +128,6 @@ Item {
147 sourceColor *= itemOpacity;
128 sourceColor *= itemOpacity;
148 gl_FragColor = sourceColor;
129 gl_FragColor = sourceColor;
151− transform: Rotation {
152− axis { x: 1; y: 0; z: 0 }
153− origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
158 QtObject {
133 QtObject {