@@ -27,7 +27,7 @@ Item {
27 property bool itemFocused: false
27 property bool itemFocused: false
28 property real maxAngle: 0
28 property real maxAngle: 0
29 property bool inverted: false
29 property bool inverted: false
30− property bool clipCorner: false
30+ property alias pinned: pin.visible
32 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
32 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
33 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
33 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
@@ -71,14 +71,31 @@ Item {
71 height: root.itemHeight - units.gu(1)
71 height: root.itemHeight - units.gu(1)
79+ topMargin: -units.dp(2)
74 UbuntuShape {
87 UbuntuShape {
75 objectName: "countEmblem"
89 objectName: "countEmblem"
91+ readonly property real pinMargin: pin.visible ? pin.width + units.gu(1) - anchors.leftMargin : 0
77 right: parent.right
94 right: parent.right
78 top: parent.top
95 top: parent.top
79 margins: units.dp(3)
96 margins: units.dp(3)
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)))
82 height: units.gu(2)
99 height: units.gu(2)
83 color: UbuntuColors.orange
100 color: UbuntuColors.orange
84 visible: root.countVisible
101 visible: root.countVisible
@@ -92,7 +109,7 @@ Item {
92 // FIXME: verticalCenter seems to be off wee bit and QML doesn't have a centerLine
109 // FIXME: verticalCenter seems to be off wee bit and QML doesn't have a centerLine
93 // property for Text: https://bugreports.qt-project.org/browse/QTBUG-40479
110 // property for Text: https://bugreports.qt-project.org/browse/QTBUG-40479
94 anchors.verticalCenterOffset: -units.dp(.5)
111 anchors.verticalCenterOffset: -units.dp(.5)
95− width: root.itemWidth - units.gu(1)
112+ width: root.itemWidth - units.gu(1) - countEmblem.pinMargin
96 horizontalAlignment: Text.AlignHCenter
113 horizontalAlignment: Text.AlignHCenter
97 elide: Text.ElideRight
114 elide: Text.ElideRight
98 color: "white"
115 color: "white"
@@ -149,24 +166,6 @@ Item {
154− anchors.centerIn: parent
155− width: iconItem.width
156− height: iconItem.height
160− topMargin: -units.gu(2)
161− leftMargin: -units.gu(2)
162− rightMargin: -units.gu(2)
163− bottomMargin: units.gu(1.2)
166− rotation: root.rotation + 45
170 ShaderEffect {
169 ShaderEffect {
171 id: transformEffect
170 id: transformEffect
172 anchors.centerIn: parent
171 anchors.centerIn: parent
@@ -176,7 +175,6 @@ Item {
176 property real itemOpacity: root.itemOpacity
175 property real itemOpacity: root.itemOpacity
177 property real brightness: Math.max(-1, root.brightness)
176 property real brightness: Math.max(-1, root.brightness)
178 property real angle: root.angle
177 property real angle: root.angle
179− property bool clipCorner: root.clipCorner
180 rotation: root.inverted ? 180 : 0
178 rotation: root.inverted ? 180 : 0
182 property variant source: ShaderEffectSource {
180 property variant source: ShaderEffectSource {
@@ -185,11 +183,6 @@ Item {
185 hideSource: true
183 hideSource: true
188− property var mask: ShaderEffectSource {
193 transform: [
186 transform: [
194 // Rotating 3 times at top/bottom because that increases the perspective.
187 // Rotating 3 times at top/bottom because that increases the perspective.
195 // This is a hack, but as QML does not support real 3D coordinates
188 // This is a hack, but as QML does not support real 3D coordinates
@@ -224,19 +217,13 @@ Item {
224 fragmentShader: "
217 fragmentShader: "
225 varying highp vec2 qt_TexCoord0;
218 varying highp vec2 qt_TexCoord0;
226 uniform sampler2D source;
219 uniform sampler2D source;
227− uniform sampler2D mask;
228 uniform lowp float brightness;
220 uniform lowp float brightness;
229 uniform lowp float itemOpacity;
221 uniform lowp float itemOpacity;
230− uniform bool clipCorner;
231 void main(void)
222 void main(void)
233 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
224 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
234− highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
235 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
225 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
236 sourceColor *= itemOpacity;
226 sourceColor *= itemOpacity;
238− sourceColor *= maskColor.a;
240 gl_FragColor = sourceColor;
227 gl_FragColor = sourceColor;