on xenial help sign in
some more work to speed it up
commit514d6aee135bd04b19602acf6b9eb298fe02454c authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 20 Jun 2013, 14:28 (13 years ago) parent4761d4e
1 file changed+58−1
Launcher/LauncherDelegate.qml+58−1
Launcher/LauncherDelegate.qml+58−1
@@ -37,6 +37,7 @@ Item {
3737
3838 property bool dragging:false
3939
40+// property real brightness: 0
4041 property alias brightness: brightnessEffect.brightness
4142
4243 signal clicked()
@@ -90,12 +91,68 @@ Item {
9091 height: width
9192 }
9293
93− BrightnessContrast {
94+/* BrightnessContrast {
9495 id: brightnessEffect
9596 anchors.fill: parent
9697 source: parent
9798 brightness: 0
9899 }
100+ */
101+
102+/* UbuntuShape {
103+ id: brightnessShape
104+ anchors.fill: parent
105+ color: "black"
106+ radius: "medium"
107+ }
108+*/
109+ }
110+ ShaderEffect {
111+ id: brightnessEffect
112+ anchors.centerIn: parent
113+ width: parent.width
114+ height: parent.height
115+ property real itemOpacity: root.opacity
116+ property real brightness: 0
117+ property real angle: root.angle
118+
119+ anchors.verticalCenterOffset: root.offset + (height - root.effectiveHeight)/2 * (angle < 0 ? 1 : -1)
120+
121+ property variant source: ShaderEffectSource {
122+ sourceItem: iconItem
123+ hideSource: true
124+ }
125+/* vertexShader: "
126+ uniform highp mat4 qt_Matrix;
127+ attribute highp vec4 qt_Vertex;
128+ varying highp vec2 qt_MultiTexCoord0;
129+ varying highp vec2 coord;
130+ uniform lowp float angle;
131+ varying highp vec2 centerPoint;
132+ void main() {
133+ coord = qt_MultiTexCoord0;
134+ highp vec4 rotatedVertex = qt_Vertex * angle;
135+ gl_Position = qt_Matrix * rotatedVertex;
136+ }"
137+*/
138+ fragmentShader: "
139+ varying highp vec2 qt_TexCoord0;
140+ uniform sampler2D source;
141+ uniform lowp float brightness;
142+ uniform lowp float itemOpacity;
143+ void main(void)
144+ {
145+ highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
146+ sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
147+ sourceColor *= itemOpacity;
148+ gl_FragColor = sourceColor;
149+ }"
150+
151+ transform: Rotation {
152+ axis { x: 1; y: 0; z: 0 }
153+ origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
154+ angle: root.angle
155+ }
99156 }
100157
101158 QtObject {