~unity-2d-team/unity-2d/shortcut-hint-overlay

« back to all changes in this revision

Viewing changes to spread/Workspaces.qml

  • Committer: Tiago Salem Herrmann
  • Date: 2012-03-19 15:28:41 UTC
  • mfrom: (771.40.182 unity-2d)
  • Revision ID: tiago.herrmann@canonical.com-20120319152841-2hfflo67muks7gca
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
    color: "black"
27
27
 
 
28
    signal cancelAndExitStarted ()
 
29
 
 
30
    property variant declarativeView
 
31
 
28
32
    property int columns: desktop.workspaces.columns
29
33
    property int rows: desktop.workspaces.rows
30
34
 
104
108
            z: -1
105
109
            width: workspaces.cellWidth
106
110
            height: workspaces.cellHeight
107
 
            visible: workspaces.currentItem.state == "unzoomed"
 
111
            visible: workspaces.currentItem.state == "unzoomed" && spreadManager.currentSwitcher == switcher
108
112
        }
109
113
        highlightFollowsCurrentItem: false
110
114
 
210
214
    function show() {
211
215
        allWindows.load()
212
216
 
213
 
        spreadView.show()
214
 
        spreadView.forceActivateWindow()
 
217
        declarativeView.show()
215
218
        workspaces.currentIndex = desktop.workspaces.current
216
219
        /* This is necessary otherwise we don't get keypresses until the user does a
217
220
           mouse over on a window */
228
231
        id: exitTransitionTimer
229
232
        interval: Utils.transitionDuration
230
233
        onTriggered: {
231
 
            spreadView.hide()
 
234
            declarativeView.hide()
232
235
 
233
236
            /* Nothing should be allowed to touch the windows anymore here, so it should
234
237
               be safe to unload them all to save memory.
263
266
    }
264
267
 
265
268
    Connections {
266
 
        target: spreadView
267
 
        onOutsideClick: cancelAndExit()
 
269
        target: spreadManager
 
270
        onStartCancelAndExit: {
 
271
            cancelAndExit(true)
 
272
        }
268
273
    }
269
274
 
270
 
    function cancelAndExit() {
 
275
    function cancelAndExit(fromSpreadManager) {
 
276
        if (!fromSpreadManager) {
 
277
            cancelAndExitStarted()
 
278
        }
271
279
        initial = true
272
280
 
273
281
        /* Let the transition finish and then hide the switcher and perform cleanup */