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
1=== modified file 'places/LensBar.qml'
2--- places/LensBar.qml 2011-08-30 21:58:24 +0000
3+++ places/LensBar.qml 2011-09-01 14:41:51 +0000
4@@ -20,6 +20,8 @@
5 import Unity2d 1.0
6
7 FocusScope {
8+ id: lensBar
9+
10 /* declare width & spacing of icons as required for layout calculations */
11 property int iconWidth: 24
12 property int iconSpacing: 36
13@@ -41,13 +43,18 @@
14 }
15
16 /* LensBar contains a row of LensButtons */
17+
18+ /* Ugly Hack: the DropShadow effect on the Home lensButton causes visual artifacts as
19+ the list of lenses is being populated, when the inter-lensButton spacing is non-zero.
20+ A previously painted DropShadow remains in the (transparent) inter-lensButton space.
21+ Can work around this by removing spacing and instead add padding to each lensButton.
22+ DropShadow not officially supported until Qt4.8, when hopefully this will be fixed. */
23 Row {
24 id: lensContainer
25
26 anchors.horizontalCenter: background.horizontalCenter
27 anchors.top: background.top
28 anchors.bottom: background.bottom
29- spacing: iconSpacing
30
31 Keys.onPressed: if (handleKeyPress(event.key)) event.accepted = true
32
33@@ -94,9 +101,10 @@
34 icon: "artwork/lens-nav-home.svg"
35 onClicked: dash.activateHome()
36 active: ( dashView.activeLens == "" )
37- width: iconWidth
38- anchors.top: parent.top
39- anchors.bottom: parent.bottom
40+ iconWidth: lensBar.iconWidth
41+ iconSpacing: lensBar.iconSpacing
42+ width: iconWidth+iconSpacing
43+ height: lensContainer.height
44 }
45
46 /* Now fetch all other lenses and display */
47@@ -109,9 +117,10 @@
48 icon: item.iconHint.indexOf("/") == -1 ? "image://icons/" + item.iconHint : item.iconHint
49 active: item.active
50 onClicked: dash.activateLens(item.id)
51- width: iconWidth
52- anchors.top: parent != undefined ? parent.top : undefined
53- anchors.bottom: parent != undefined ? parent.bottom : undefined
54+ iconWidth: lensBar.iconWidth
55+ iconSpacing: lensBar.iconSpacing
56+ width: iconWidth+iconSpacing
57+ height: lensContainer.height
58 }
59 }
60 }
61
62=== modified file 'places/LensButton.qml'
63--- places/LensButton.qml 2011-08-12 17:04:39 +0000
64+++ places/LensButton.qml 2011-09-01 14:41:51 +0000
65@@ -25,6 +25,8 @@
66 AbstractButton {
67 property alias icon: icon.source
68 property bool active: false
69+ property int iconSpacing: 0
70+ property int iconWidth: 24
71
72 id: lensButton
73
74@@ -40,6 +42,8 @@
75 anchors.fill: parent
76 anchors.topMargin: 7
77 anchors.bottomMargin: 7
78+ anchors.leftMargin: Math.floor(iconSpacing/2)
79+ anchors.rightMargin: Math.ceil(iconSpacing/2)
80
81 border.color: "white"
82 border.width: 1

Subscribers

People subscribed via source and target branches