~mzanetti/unity8/modeswitchwarning

« back to all changes in this revision

Viewing changes to qml/Shell.qml

  • Committer: Michael Zanetti
  • Date: 2015-10-26 16:47:52 UTC
  • mfrom: (1978.2.32 trunk)
  • Revision ID: michael.zanetti@canonical.com-20151026164752-8yt7ngcng344mb67
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import QtQuick 2.0
18
18
import QtQuick.Window 2.0
19
19
import AccountsService 0.1
20
 
import GSettings 1.0
21
20
import Unity.Application 0.1
22
21
import Ubuntu.Components 0.1
23
22
import Ubuntu.Components.Popups 1.0
41
40
import Unity.Session 0.1
42
41
import Unity.DashCommunicator 0.1
43
42
import Unity.Indicators 0.1 as Indicators
 
43
import Cursor 1.0
44
44
 
45
45
 
46
46
Item {
63
63
    function updateFocusedAppOrientationAnimated() {
64
64
        applicationsDisplayLoader.item.updateFocusedAppOrientationAnimated();
65
65
    }
66
 
    property bool hasMouse
 
66
    property bool hasMouse: false
67
67
 
68
68
    // to be read from outside
69
69
    readonly property int mainAppWindowOrientationAngle:
107
107
    enabled: greeter && !greeter.waiting
108
108
 
109
109
    property real edgeSize: units.gu(2)
110
 
    property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg")
111
 
    property url background: asImageTester.status == Image.Ready ? asImageTester.source
112
 
                             : gsImageTester.status == Image.Ready ? gsImageTester.source : defaultBackground
 
110
 
 
111
    WallpaperResolver {
 
112
        id: wallpaperResolver
 
113
        width: shell.width
 
114
    }
113
115
 
114
116
    readonly property alias greeter: greeterLoader.item
115
117
 
130
132
        shell.activateApplication(app);
131
133
    }
132
134
 
133
 
    // This is a dummy image to detect if the custom AS set wallpaper loads successfully.
134
 
    Image {
135
 
        id: asImageTester
136
 
        source: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : ""
137
 
        height: 0
138
 
        width: 0
139
 
        sourceSize.height: 0
140
 
        sourceSize.width: 0
141
 
    }
142
 
 
143
 
    GSettings {
144
 
        id: backgroundSettings
145
 
        schema.id: "org.gnome.desktop.background"
146
 
    }
147
 
 
148
 
    // This is a dummy image to detect if the custom GSettings set wallpaper loads successfully.
149
 
    Image {
150
 
        id: gsImageTester
151
 
        source: backgroundSettings.pictureUri && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : ""
152
 
        height: 0
153
 
        width: 0
154
 
        sourceSize.height: 0
155
 
        sourceSize.width: 0
156
 
    }
157
 
 
158
135
    Binding {
159
136
        target: LauncherModel
160
137
        property: "applicationManager"
190
167
        onScreenshotTriggered: screenGrabber.capture();
191
168
    }
192
169
 
193
 
    ScreenGrabber {
194
 
        id: screenGrabber
195
 
        z: dialogs.z + 10
196
 
    }
197
 
 
198
170
    GlobalShortcut {
199
171
        // dummy shortcut to force creation of GlobalShortcutRegistry before WindowKeyFilter
200
172
    }
327
299
            Binding {
328
300
                target: applicationsDisplayLoader.item
329
301
                property: "background"
330
 
                value: shell.background
 
302
                value: wallpaperResolver.background
331
303
            }
332
304
            Binding {
333
305
                target: applicationsDisplayLoader.item
432
404
            tabletMode: shell.usageScenario != "phone"
433
405
            launcherOffset: launcher.progress
434
406
            forcedUnlock: tutorial.running
435
 
            background: shell.background
 
407
            background: wallpaperResolver.background
436
408
 
437
409
            // avoid overlapping with Launcher's edge drag area
438
410
            // FIXME: Fix TouchRegistry & friends and remove this workaround
607
579
            id: wizard
608
580
            objectName: "wizard"
609
581
            anchors.fill: parent
610
 
            background: shell.background
 
582
            background: wallpaperResolver.background
611
583
 
612
584
            function unlockWhenDoneWithWizard() {
613
585
                if (!active) {
638
610
            model: NotificationBackend.Model
639
611
            margin: units.gu(1)
640
612
            hasMouse: shell.hasMouse
 
613
            background: wallpaperResolver.background
641
614
 
642
615
            y: topmostIsFullscreen ? 0 : panel.panelHeight
643
616
            height: parent.height - (topmostIsFullscreen ? 0 : panel.panelHeight)
684
657
        onShowHome: showHome()
685
658
    }
686
659
 
 
660
    ScreenGrabber {
 
661
        id: screenGrabber
 
662
        rotationAngle: -shell.orientationAngle
 
663
        z: dialogs.z + 10
 
664
    }
 
665
 
 
666
    Cursor {
 
667
        id: cursor
 
668
        visible: shell.hasMouse
 
669
        z: screenGrabber.z + 1
 
670
    }
 
671
 
687
672
    Rectangle {
688
673
        id: shutdownFadeOutRectangle
689
 
        z: screenGrabber.z + 10
 
674
        z: cursor.z + 1
690
675
        enabled: false
691
676
        visible: false
692
677
        color: "black"