Ubuntu Pastebin

Paste from mzanetti at Mon, 1 Jun 2015 10:27:29 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import QtQuick 2.2
import GSettings 1.0
 
Item {
    width: 500
    height: 500

    GSettings {
        id: settings
        schema.id: "com.canonical.Unity8"
    }
 
    Loader {
        id: loader
        anchors.fill: parent
        sourceComponent: settings.usageMode === "Windowed" ? comp1 : comp2
  
    }
 
    Component { // windowed
        id: comp1
        Rectangle { color: "green"; Component.onCompleted: print("comp1 created"); Component.onDestruction: print("comp1 destroyed") }
    }
    Component { // Staged
        id: comp2
        Rectangle { color: "red"; Component.onCompleted: print("comp2 created"); Component.onDestruction: print("comp2 destroyed") }
    }
}
 
Download as text