~dyams/unity-2d/remove-glow

« back to all changes in this revision

Viewing changes to spread/Workspaces.qml

  • Committer: Tarmac
  • Author(s): Michał Sawicz, Albert Astals
  • Date: 2012-02-07 11:29:36 UTC
  • mfrom: (879.11.17 refactor-screeninfo)
  • Revision ID: tarmac-20120207112936-r1iya0418z3d7evn
This, in itself, will not change anything in unity-2d, but will later allow for easier multi-monitor implementation.. Fixes: . Approved by Gerry Boland.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
    color: "black"
27
27
 
28
 
    property int columns: screen.workspaces.columns
29
 
    property int rows: screen.workspaces.rows
 
28
    property int columns: desktop.workspaces.columns
 
29
    property int rows: desktop.workspaces.rows
30
30
 
31
31
    property int margin: 35
32
32
    property int spacing: 4
57
57
 
58
58
    /* Scale of a workspace when the user zooms on it (fills most of the switcher, leaving a margin to see
59
59
       the corners of the other workspaces below it) */
60
 
    property bool isDesktopHorizontal: screen.panelsFreeGeometry.width > screen.panelsFreeGeometry.height
 
60
    property bool isDesktopHorizontal: declarativeView.screen.panelsFreeGeometry.width > declarativeView.screen.panelsFreeGeometry.height
61
61
    property real zoomedScale: (isDesktopHorizontal) ? ((width - 2*margin) / switcher.width) :
62
62
                                                       ((height - 2*margin) / switcher.height)
63
63
 
85
85
        width: cellWidth * columns
86
86
        height: cellHeight * rows
87
87
 
88
 
        model: screen.workspaces.count
 
88
        model: desktop.workspaces.count
89
89
        cellWidth: parent.cellWidth + spacing
90
90
        cellHeight: parent.cellHeight + spacing
91
91
        keyNavigationWraps: true
136
136
            }
137
137
            state: {
138
138
                if (initial) {
139
 
                    if (screen.workspaces.current == workspaceNumber) {
 
139
                    if (desktop.workspaces.current == workspaceNumber) {
140
140
                        return "screen"
141
141
                    } else {
142
142
                        return "unzoomed"
189
189
            /* Setup application pre-filtering and initially zoomed desktop, if any
190
190
               were specified as arguments */
191
191
            applicationFilter = applicationDesktopFile
192
 
            zoomedWorkspace = screen.workspaces.current
 
192
            zoomedWorkspace = desktop.workspaces.current
193
193
            show()
194
194
        }
195
195
 
196
196
        onShowAllWorkspaces: {
197
 
            if (screen.workspaces.count > 1) {
 
197
            if (desktop.workspaces.count > 1) {
198
198
                applicationFilter = applicationDesktopFile
199
199
                zoomedWorkspace = -1
200
200
                show()
211
211
    function show() {
212
212
        /* Save the currently active window before showing and activating the switcher,
213
213
           so that we can use it to pre-select the active window on the workspace */
214
 
        lastActiveWindow = screen.activeWindow
 
214
        lastActiveWindow = desktop.activeWindow
215
215
 
216
216
        allWindows.load()
217
217
 
218
218
        spreadView.show()
219
219
        spreadView.forceActivateWindow()
220
 
        workspaces.currentIndex = screen.workspaces.current
 
220
        workspaces.currentIndex = desktop.workspaces.current
221
221
        /* This is necessary otherwise we don't get keypresses until the user does a
222
222
           mouse over on a window */
223
223
        workspaces.forceActiveFocus()
280
280
    }
281
281
 
282
282
    function activateWindow(windowInfo) {
283
 
        screen.workspaces.changeCurrent(zoomedWorkspace)
 
283
        desktop.workspaces.changeCurrent(zoomedWorkspace)
284
284
        windowInfo.activate()
285
285
        cancelAndExit()
286
286
    }
287
287
 
288
288
    function activateWorkspace(workspaceNumber) {
289
 
        screen.workspaces.changeCurrent(workspaceNumber)
 
289
        desktop.workspaces.changeCurrent(workspaceNumber)
290
290
        cancelAndExit()
291
291
    }
292
292
}