on xenial help sign in
Redesign for pinned apps. Remove thindivider on top of ubuntu dash button (not needed anymore)
commiteec67aa2317b81a635755d52f599d7ff8f6df2a1 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateTue 7 Oct 2014, 09:25 (12 years ago) parent48f22f3
2 files changed+20−44
qml/Launcher/LauncherDelegate.qml+15−30 qml/Launcher/LauncherPanel.qml+5−14
qml/Launcher/LauncherDelegate.qml+15−30
@@ -27,7 +27,7 @@ Item {
2727 property bool itemFocused: false
2828 property real maxAngle: 0
2929 property bool inverted: false
30− property bool clipCorner: false
30+ property alias pinned: pin.visible
3131
3232 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
3333 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
@@ -71,6 +71,20 @@ Item {
7171 height: root.itemHeight - units.gu(1)
7272 }
7373
74+ Rectangle {
75+ id: pin
76+ anchors {
77+ left: iconShape.left
78+ top: iconShape.top
79+ topMargin: -units.dp(2)
80+ }
81+ width: units.gu(1)
82+ height: width
83+ radius: width / 2
84+ antialiasing: true
85+ color: "white"
86+ }
87+
7488 UbuntuShape {
7589 objectName: "countEmblem"
7690 anchors {
@@ -149,24 +163,6 @@ Item {
149163 }
150164 }
151165
152− Item {
153− id: clipper
154− anchors.centerIn: parent
155− width: iconItem.width
156− height: iconItem.height
157− Rectangle {
158− anchors {
159− fill: parent
160− topMargin: -units.gu(2)
161− leftMargin: -units.gu(2)
162− rightMargin: -units.gu(2)
163− bottomMargin: units.gu(1.2)
164− }
165− color: "red"
166− rotation: root.rotation + 45
167− }
168− }
169−
170166 ShaderEffect {
171167 id: transformEffect
172168 anchors.centerIn: parent
@@ -176,7 +172,6 @@ Item {
176172 property real itemOpacity: root.itemOpacity
177173 property real brightness: Math.max(-1, root.brightness)
178174 property real angle: root.angle
179− property bool clipCorner: root.clipCorner
180175 rotation: root.inverted ? 180 : 0
181176
182177 property variant source: ShaderEffectSource {
@@ -185,11 +180,6 @@ Item {
185180 hideSource: true
186181 }
187182
188− property var mask: ShaderEffectSource {
189− sourceItem: clipper
190− hideSource: true
191− }
192−
193183 transform: [
194184 // Rotating 3 times at top/bottom because that increases the perspective.
195185 // This is a hack, but as QML does not support real 3D coordinates
@@ -224,19 +214,14 @@ Item {
224214 fragmentShader: "
225215 varying highp vec2 qt_TexCoord0;
226216 uniform sampler2D source;
227− uniform sampler2D mask;
228217 uniform lowp float brightness;
229218 uniform lowp float itemOpacity;
230219 uniform bool clipCorner;
231220 void main(void)
232221 {
233222 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
234− highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
235223 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
236224 sourceColor *= itemOpacity;
237− if (clipCorner) {
238− sourceColor *= maskColor.a;
239− }
240225 gl_FragColor = sourceColor;
241226 }"
242227 }
qml/Launcher/LauncherPanel.qml+5−14
@@ -65,15 +65,6 @@ Rectangle {
6565 }
6666 }
6767
68− ThinDivider {
69− anchors {
70− left: parent.left
71− right: parent.right
72− margins: -mainColumn.anchors.leftMargin
73− }
74− rotation: root.rotation
75− }
76−
7768 Item {
7869 anchors.left: parent.left
7970 anchors.right: parent.right
@@ -158,7 +149,7 @@ Rectangle {
158149 count: model.count
159150 countVisible: model.countVisible
160151 progress: model.progress
161− clipCorner: model.pinned
152+ pinned: model.pinned
162153 itemFocused: model.focused
163154 inverted: root.inverted
164155 z: -Math.abs(offset)
@@ -469,10 +460,10 @@ Rectangle {
469460 width: itemWidth
470461 rotation: root.rotation
471462 itemOpacity: 0.9
472− clipCorner: dndArea.draggedIndex > -1 &&
473− LauncherModel.get(dndArea.draggedIndex).pinned &&
474− !dndArea.preDragging &&
475− !dndArea.dragging
463+ pinned: dndArea.draggedIndex > -1 &&
464+ LauncherModel.get(dndArea.draggedIndex).pinned &&
465+ !dndArea.preDragging &&
466+ !dndArea.dragging
476467
477468 function flatten() {
478469 fakeDragItemAnimation.start();