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

« back to all changes in this revision

Viewing changes to shell/common/Background.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:
19
19
import QtQuick 1.1
20
20
import Unity2d 1.0
21
21
import Effects 1.0
 
22
import "utils.js" as Utils
22
23
 
23
24
Item {
24
25
    id: background
26
27
    property bool fullscreen: false
27
28
    property int bottomBorderThickness
28
29
    property int rightBorderThickness
 
30
    property bool activeTriggerHelper: true
 
31
    property bool reallyActive: active && activeTriggerHelper
 
32
    property variant view: undefined
 
33
 
 
34
    function trigger()
 
35
    {
 
36
        activeTriggerHelper = false
 
37
        activeTriggerHelper = true
 
38
    }
29
39
 
30
40
    /* Avoid redraw at rendering */
31
41
    effect: CacheEffect {}
48
58
 
49
59
            /* Use an image of the root window which essentially is a
50
60
               capture of the entire screen */
51
 
            source: active ? "image://window/root" : ""
 
61
            source: reallyActive ? "image://window/root" : ""
52
62
            cache: false
53
63
 
54
64
            fillMode: Image.PreserveAspectCrop
56
66
            /* Place the screenshot of the desktop background on top of the desktop background,
57
67
               no matter where the DeclarativeView or the parent object are placed.
58
68
            */
59
 
            property variant origin: parent.mapFromItem(null, -declarativeView.globalPosition.x, -declarativeView.globalPosition.y)
 
69
            property variant origin: parent.mapFromItem(null, background.view != undefined ? -background.view.globalPosition.x : -declarativeView.globalPosition.x,
 
70
                                                              background.view != undefined ? -background.view.globalPosition.y : -declarativeView.globalPosition.y)
60
71
            x: origin.x
61
72
            y: origin.y
62
73
        }
77
88
 
78
89
        anchors.fill: parent
79
90
        source: desktop.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci"
80
 
        mirror: isRightToLeft()
 
91
        mirror: Utils.isRightToLeft()
81
92
    }
82
93
 
83
94
    states: [