~ubuntu-branches/ubuntu/oneiric/unity-2d/oneiric-proposed

« back to all changes in this revision

Viewing changes to places/LensBar.qml

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2011-09-01 17:41:00 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: package-import@ubuntu.com-20110901174100-sjvqygd6sh9n315d
Tags: 4.4.0-0ubuntu1
* New upstream release:
  - unity-2d-panel crashed with SIGSEGV in QConfSchema::findKey()
    (LP: #834045)
  - unity-2d-panel crashed with SIGSEGV in QConf::notify() (LP: #834001)
  - [panel] Implement whitelisting for legacy tray applet (LP: #707354)
  - [launcher] stops automatically hiding after some time using it
    (LP: #821180)
  - [panel] Empathy displays icon in deprecated systray (LP: #830017)
  - [dash] Invalid UTF-8 in the dash (LP: #836587)
  - [dash] Home buttons 'Media' and 'Internet' apps should not only take you
    to the apps lens but also activate the right filter (LP: #837360)
  - [dash] Drag&drop application from dash to launcher is broken
    (LP: #837361)
  - [launcher] contextual menu's corner has a blue line (LP: #828386)
  - [dash] Lens bar graphical layout glitches (LP: #833805)
  - [dash] Rating Filter: All button not clearing star highlighting
    (LP: #834640)
  - [dash] should be falling back to the default renderer if the renderer
    requested by the lens is not found (LP: #837356)
  - [dash] Gwibber lens icon doesn't show up in 2d unity (LP: #830728)
  - [dash] Lacks horizontal renderer used by lenses such as Gwibber
    (LP: #837712)
  - [dash] See %1 more result inconsistency (LP: #834226)
  - [launcher] When application has no icon, a question mark icon should be
    displayed (LP: #837351)
  - unity places should return a default icon when no matching icon is found
    (LP: #711200)
  - spacing between indicators should be 5 pixels (LP: #734010)
* debian/control:
  - require current nux and unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import Unity2d 1.0
21
21
 
22
22
FocusScope {
 
23
    id: lensBar
 
24
 
23
25
    /* declare width & spacing of icons as required for layout calculations */
24
26
    property int iconWidth: 24
25
27
    property int iconSpacing: 36
41
43
    }
42
44
 
43
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
52
    Row {
45
53
        id: lensContainer
46
54
 
47
55
        anchors.horizontalCenter: background.horizontalCenter
48
56
        anchors.top: background.top
49
57
        anchors.bottom: background.bottom
50
 
        spacing: iconSpacing
51
58
 
52
59
        Keys.onPressed: if (handleKeyPress(event.key)) event.accepted = true
53
60
 
94
101
            icon: "artwork/lens-nav-home.svg"
95
102
            onClicked: dash.activateHome()
96
103
            active: ( dashView.activeLens == "" )
97
 
            width: iconWidth
98
 
            anchors.top: parent.top
99
 
            anchors.bottom: parent.bottom
 
104
            iconWidth: lensBar.iconWidth
 
105
            iconSpacing: lensBar.iconSpacing
 
106
            width: iconWidth+iconSpacing
 
107
            height: lensContainer.height
100
108
        }
101
109
 
102
110
        /* Now fetch all other lenses and display */
105
113
 
106
114
            model: visibleLenses
107
115
            delegate: LensButton {
108
 
                icon: item.iconHint
 
116
                /* Heuristic: if iconHint does not contain a '/' then it is an icon name */
 
117
                icon: item.iconHint.indexOf("/") == -1 ? "image://icons/" + item.iconHint : item.iconHint
109
118
                active: item.active
110
119
                onClicked: dash.activateLens(item.id)
111
 
                width: iconWidth
112
 
                anchors.top: parent != undefined ? parent.top : undefined
113
 
                anchors.bottom: parent != undefined ? parent.bottom : undefined
 
120
                iconWidth: lensBar.iconWidth
 
121
                iconSpacing: lensBar.iconSpacing
 
122
                width: iconWidth+iconSpacing
 
123
                height: lensContainer.height
114
124
            }
115
125
        }
116
126
    }