@@ -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,14 +71,31 @@ 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+ color: "white"
85+ }
86+
7487 UbuntuShape {
88+ id: countEmblem
7589 objectName: "countEmblem"
90+
91+ readonly property real pinMargin: pin.visible ? pin.width + units.gu(1) - anchors.leftMargin : 0
92+
7693 anchors {
7794 right: parent.right
7895 top: parent.top
7996 margins: units.dp(3)
8097 }
81− width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
98+ width: Math.min(root.itemWidth - pinMargin, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
8299 height: units.gu(2)
83100 color: UbuntuColors.orange
84101 visible: root.countVisible
@@ -92,7 +109,7 @@ Item {
92109 // FIXME: verticalCenter seems to be off wee bit and QML doesn't have a centerLine
93110 // property for Text: https://bugreports.qt-project.org/browse/QTBUG-40479
94111 anchors.verticalCenterOffset: -units.dp(.5)
95− width: root.itemWidth - units.gu(1)
112+ width: root.itemWidth - units.gu(1) - countEmblem.pinMargin
96113 horizontalAlignment: Text.AlignHCenter
97114 elide: Text.ElideRight
98115 color: "white"
@@ -149,24 +166,6 @@ Item {
149166 }
150167 }
151168
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−
170169 ShaderEffect {
171170 id: transformEffect
172171 anchors.centerIn: parent
@@ -176,7 +175,6 @@ Item {
176175 property real itemOpacity: root.itemOpacity
177176 property real brightness: Math.max(-1, root.brightness)
178177 property real angle: root.angle
179− property bool clipCorner: root.clipCorner
180178 rotation: root.inverted ? 180 : 0
181179
182180 property variant source: ShaderEffectSource {
@@ -185,11 +183,6 @@ Item {
185183 hideSource: true
186184 }
187185
188− property var mask: ShaderEffectSource {
189− sourceItem: clipper
190− hideSource: true
191− }
192−
193186 transform: [
194187 // Rotating 3 times at top/bottom because that increases the perspective.
195188 // This is a hack, but as QML does not support real 3D coordinates
@@ -224,19 +217,13 @@ Item {
224217 fragmentShader: "
225218 varying highp vec2 qt_TexCoord0;
226219 uniform sampler2D source;
227− uniform sampler2D mask;
228220 uniform lowp float brightness;
229221 uniform lowp float itemOpacity;
230− uniform bool clipCorner;
231222 void main(void)
232223 {
233224 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
234− highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
235225 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
236226 sourceColor *= itemOpacity;
237− if (clipCorner) {
238− sourceColor *= maskColor.a;
239− }
240227 gl_FragColor = sourceColor;
241228 }"
242229 }