~ubuntu-branches/ubuntu/raring/unity-2d/raring

« back to all changes in this revision

Viewing changes to shell/launcher/LauncherList.qml

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2012-03-19 14:07:10 UTC
  • mfrom: (1.1.29)
  • Revision ID: package-import@ubuntu.com-20120319140710-uo2kqjoscac55y2s
Tags: 5.7.0-0ubuntu1
* New upstream release:
  - unity-2d-panel crashed with SIGABRT in Unity2dDebug::unity2dQtHandler()
    (LP: #925457)
  - unity-2d-shell crashed with SIGSEGV in ref() (LP: #947278)
  - Launcher - Make Launcher left of screen reveal more responsive and less
    prone to false positives (LP: #765819)
  - [dash] [launcher] [panel] Tinting based on wallpaper missing
    (LP: #882101)
  - [launcher] In multimonitor setup Unity-2D only shows launcher on one
    monitor (fails MM UX spec #2.8) (LP: #780204)
  - [unity-2d] FF exception to add PointerBarrier to Unity2d (LP: #947976)
  - multimonitor, launcher: Provide an option to display either a single
    launcher or a launcher on each display in a multi-monitor environment
    (LP: #950136)
  - lens switching is not keyboard navigable (LP: #945220)
  - [panel] [multi-monitor] On secondary screen, unable to scrub from
    indicator menu to app menu (LP: #844809)
  - "Workspaces" button displays previous wallpaper (LP: #900019)
  - Dash - cursor should change when pointer is over the search field
    (LP: #849175)
  - Filter checkboxes are without margins in right to left locales
    (LP: #949319)
  - [panel] [multi-monitor] Open indicator menu on one screen causes other
    indicator to look open too (LP: #844798)
  - Dash - horizental divider line in between categories incorrectly drawn
    (LP: #841750)
  - [launcher] Tile Progress bar starting from left of launcher, not
    container (LP: #912777)
  - Dash - dash is not closed with alt+f4 (LP: #891818)
  - [dash] Rating stars in right-to-left locales behave inconsistently.
    (LP: #945719)
  - LensButton.qml:72 warning when running unity-2d (LP: #947276)
  - [dash] Multi-range filters are rendered incorrectly in right-to-left
    locales (LP: #950649)
* debian/unity-2d.gconf-defaults:
  - removed: not used anymore and causing regression with hide-mode=2
    by default, converted to the gsettings key (LP: #942772)
* debian/unity-2d.preinst:
  - removed, was a natty -> oneiric transition
* debian/control, debian/unity-2d-common.install:
  - create unity-2d-common and make some packages depending on it
  - move some files from unity-2d package to unity-2d-common
    (gsettings and apport hook) to have packaging shipping their schema
    (LP: #925457)
* debian/unity-2d-common.install.in:
  - no more gconf -> gsettings migration shipped
* debian/unity-2d.postinst, prerm, trigger:
  - moved to unity-2d-common new package, to ensure even people uninstalling
    unity-2d got the right metacity configuration in the session
  - update the trigger to the correct directory
* debian/control:
  - bump to latest Standards-Version
  - fix some too long description
  - put the transitional packages in the oldlibs/extra section
  - build-dep on libxtst-dev, libxfixes-dev for barrier change
  - need latest metacity for barriers to work

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import QtQuick 1.0
20
20
import Unity2d 1.0 /* required for drag’n’drop handling */
 
21
import "../common/utils.js" as Utils
21
22
 
22
23
AutoScrollingListView {
23
24
    id: list
93
94
        }
94
95
 
95
96
        function updatePips() {
96
 
            if (item.belongsToDifferentWorkspace()) {
 
97
            var windowCount = item.windowsOnCurrentWorkspaceScreen(launcher2dConfiguration.onlyOneLauncher ? -1 : declarativeView.screen.screen);
 
98
            if (windowCount == 0 && item.windowCount != 0) {
97
99
                launcherItem.pips = 1
98
100
                launcherItem.pipSource = "launcher/artwork/launcher_arrow_outline_ltr.png";
99
101
            } else {
100
 
                launcherItem.pips = Math.min(item.windowCount, 3)
 
102
                launcherItem.pips = Math.min(windowCount, 3)
101
103
                launcherItem.pipSource = ("launcher/artwork/launcher_" + ((pips <= 1) ? "arrow" : "pip") + "_ltr.png")
102
104
            }
103
105
        }
113
115
        icon: item.icon != "" ? "image://icons/" + item.icon : "image://icons/unknown"
114
116
        running: item.running
115
117
        active: item.active
 
118
        activeOnThisScreen: item.activeScreen == declarativeView.screen.screen
116
119
        urgent: item.urgent
117
120
        launching: item.launching
118
 
        pips: Math.min(item.windowCount, 3)
119
121
 
120
122
        counter: item.counter
121
123
        counterVisible: item.counterVisible
125
127
        emblemVisible: item.emblemVisible
126
128
 
127
129
        /* Launcher of index 0 is the so-called BFB or Dash launcher */
128
 
        shortcutVisible: declarativeView.superKeyHeld &&
 
130
        shortcutVisible: shellManager.superKeyHeld &&
129
131
                         ((item.toString().indexOf("Application") == 0 && index > 0 && index <= 10) ||
130
132
                          item.shortcutKey != 0)
131
133
        shortcutText: {
157
159
                list.visibleMenu.hide()
158
160
            }
159
161
            list.visibleMenu = item.menu
160
 
            item.menu.show(width - 5, declarativeView.globalPosition.y + list.y - list.contentY +
 
162
            item.menu.show(declarativeView.globalPosition.x + width - 5, declarativeView.globalPosition.y + list.y - list.contentY +
161
163
                                  y + height - selectionOutlineSize / 2)
162
164
        }
163
165
 
198
200
        }
199
201
 
200
202
        Keys.onPressed: {
201
 
            if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter || event.key == Qt.Key_Space) {
 
203
            var key = Utils.switchLeftRightKeys(event.key)
 
204
            if (key == Qt.Key_Return || key == Qt.Key_Enter || key == Qt.Key_Space) {
202
205
                item.menu.hide()
203
206
                item.activate()
204
207
                event.accepted = true
205
208
            }
206
 
            else if ((event.key == Qt.Key_Right && list.showMenus) ||
207
 
                    (event.key == Qt.Key_F10 && (event.modifiers & Qt.ShiftModifier))) {
 
209
            else if ((key == Qt.Key_Right && list.showMenus) ||
 
210
                    (key == Qt.Key_F10 && (event.modifiers & Qt.ShiftModifier))) {
208
211
                /* Show the menu first, then unfold it. Doing things in this
209
212
                   order is required because at the moment the code path that
210
213
                   adjusts the position of the menu in case it goes offscreen
215
218
                item.menu.setFocus()
216
219
                event.accepted = true
217
220
            }
218
 
            else if (event.key == Qt.Key_Left) {
 
221
            else if (key == Qt.Key_Left) {
219
222
                item.menu.hide()
220
223
                event.accepted = true
221
224
            }
262
265
 
263
266
        function setIconGeometry() {
264
267
            if (running) {
265
 
                item.setIconGeometry(x + declarativeView.globalPosition.x,
 
268
                var screen = launcher2dConfiguration.onlyOneLauncher ? -1 : declarativeView.screen.screen
 
269
                var left = declarativeView.globalPosition.x
 
270
                if (Utils.isRightToLeft())
 
271
                    left += shell.width - x - width
 
272
                else
 
273
                    left += x
 
274
                item.setIconGeometry(left,
266
275
                                     y + declarativeView.globalPosition.y,
267
 
                                     width, height)
 
276
                                     width, height, screen)
268
277
            }
269
278
        }
270
279
 
304
313
 
305
314
        Connections {
306
315
            target: item
307
 
            onWindowAdded: item.setIconGeometry(x + declarativeView.globalPosition.x,
308
 
                                                y + declarativeView.globalPosition.y,
309
 
                                                width, height, xid)
 
316
            onWindowAdded: {
 
317
                var screen = launcher2dConfiguration.onlyOneLauncher ? -1 : declarativeView.screen.screen
 
318
                var left = declarativeView.globalPosition.x
 
319
                if (Utils.isRightToLeft())
 
320
                    left += shell.width - x - width
 
321
                else
 
322
                    left += x
 
323
                item.setIconGeometry(left,
 
324
                                     y + declarativeView.globalPosition.y,
 
325
                                     width, height, screen, xid)
 
326
            }
310
327
            onWindowCountChanged: updatePips()
311
328
            onWindowWorkspaceChanged: updatePips()
 
329
            onWindowGeometryChanged: {
 
330
                updatePips()
 
331
                setIconGeometry()
 
332
            }
312
333
            /* Not all items are applications. */
313
334
            ignoreUnknownSignals: true
314
335
        }
353
374
        }
354
375
 
355
376
        Connections {
356
 
            target: declarativeView
 
377
            target: shellManager
357
378
            onActiveWorkspaceChanged: updatePips()
358
379
        }
359
380
        Component.onCompleted: updatePips()