Merge lp:~gerboland/unity-2d/lensBar-visual-artifacts-fix into lp:unity-2d

Proposed by Gerry Boland
Status: Merged
Approved by: Florian Boucault
Approved revision: 674
Merged at revision: 689
Proposed branch: lp:~gerboland/unity-2d/lensBar-visual-artifacts-fix
Merge into: lp:unity-2d
Diff against target: 82 lines (+20/-7)
2 files modified
places/LensBar.qml (+16/-7)
places/LensButton.qml (+4/-0)
To merge this branch: bzr merge lp:~gerboland/unity-2d/lensBar-visual-artifacts-fix
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+73675@code.launchpad.net

Description of the change

[dash] HACK: the DropShadow effect on the Home lensButton causes visual artifacts as the list of lenses is being populated, when the inter-lensButton spacing is non-zero. Can work around this by removing spacing and instead add padding to each lensButton. Fixes bug:833805

To post a comment you must log in.
674. By Gerry Boland

Merge with unity-2d trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'places/LensBar.qml'
--- places/LensBar.qml 2011-08-30 21:58:24 +0000
+++ places/LensBar.qml 2011-09-01 14:41:51 +0000
@@ -20,6 +20,8 @@
20import Unity2d 1.020import Unity2d 1.0
2121
22FocusScope {22FocusScope {
23 id: lensBar
24
23 /* declare width & spacing of icons as required for layout calculations */25 /* declare width & spacing of icons as required for layout calculations */
24 property int iconWidth: 2426 property int iconWidth: 24
25 property int iconSpacing: 3627 property int iconSpacing: 36
@@ -41,13 +43,18 @@
41 }43 }
4244
43 /* LensBar contains a row of LensButtons */45 /* LensBar contains a row of LensButtons */
46
47 /* Ugly Hack: the DropShadow effect on the Home lensButton causes visual artifacts as
48 the list of lenses is being populated, when the inter-lensButton spacing is non-zero.
49 A previously painted DropShadow remains in the (transparent) inter-lensButton space.
50 Can work around this by removing spacing and instead add padding to each lensButton.
51 DropShadow not officially supported until Qt4.8, when hopefully this will be fixed. */
44 Row {52 Row {
45 id: lensContainer53 id: lensContainer
4654
47 anchors.horizontalCenter: background.horizontalCenter55 anchors.horizontalCenter: background.horizontalCenter
48 anchors.top: background.top56 anchors.top: background.top
49 anchors.bottom: background.bottom57 anchors.bottom: background.bottom
50 spacing: iconSpacing
5158
52 Keys.onPressed: if (handleKeyPress(event.key)) event.accepted = true59 Keys.onPressed: if (handleKeyPress(event.key)) event.accepted = true
5360
@@ -94,9 +101,10 @@
94 icon: "artwork/lens-nav-home.svg"101 icon: "artwork/lens-nav-home.svg"
95 onClicked: dash.activateHome()102 onClicked: dash.activateHome()
96 active: ( dashView.activeLens == "" )103 active: ( dashView.activeLens == "" )
97 width: iconWidth104 iconWidth: lensBar.iconWidth
98 anchors.top: parent.top105 iconSpacing: lensBar.iconSpacing
99 anchors.bottom: parent.bottom106 width: iconWidth+iconSpacing
107 height: lensContainer.height
100 }108 }
101109
102 /* Now fetch all other lenses and display */110 /* Now fetch all other lenses and display */
@@ -109,9 +117,10 @@
109 icon: item.iconHint.indexOf("/") == -1 ? "image://icons/" + item.iconHint : item.iconHint117 icon: item.iconHint.indexOf("/") == -1 ? "image://icons/" + item.iconHint : item.iconHint
110 active: item.active118 active: item.active
111 onClicked: dash.activateLens(item.id)119 onClicked: dash.activateLens(item.id)
112 width: iconWidth120 iconWidth: lensBar.iconWidth
113 anchors.top: parent != undefined ? parent.top : undefined121 iconSpacing: lensBar.iconSpacing
114 anchors.bottom: parent != undefined ? parent.bottom : undefined122 width: iconWidth+iconSpacing
123 height: lensContainer.height
115 }124 }
116 }125 }
117 }126 }
118127
=== modified file 'places/LensButton.qml'
--- places/LensButton.qml 2011-08-12 17:04:39 +0000
+++ places/LensButton.qml 2011-09-01 14:41:51 +0000
@@ -25,6 +25,8 @@
25AbstractButton {25AbstractButton {
26 property alias icon: icon.source26 property alias icon: icon.source
27 property bool active: false27 property bool active: false
28 property int iconSpacing: 0
29 property int iconWidth: 24
2830
29 id: lensButton31 id: lensButton
3032
@@ -40,6 +42,8 @@
40 anchors.fill: parent42 anchors.fill: parent
41 anchors.topMargin: 743 anchors.topMargin: 7
42 anchors.bottomMargin: 744 anchors.bottomMargin: 7
45 anchors.leftMargin: Math.floor(iconSpacing/2)
46 anchors.rightMargin: Math.ceil(iconSpacing/2)
4347
44 border.color: "white"48 border.color: "white"
45 border.width: 149 border.width: 1

Subscribers

People subscribed via source and target branches