~lukas-kde/miral/shellchrome-windowinfo

« back to all changes in this revision

Viewing changes to miral-qt/demos/qml-demo-shell/qml-demo-shell.qml

  • Committer: Larry Price
  • Date: 2016-09-13 16:19:29 UTC
  • mto: (330.4.1 miral)
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: larry.price@canonical.com-20160913161929-vs9ka1capmljq1es
Removing miral-qt from release branch, updating copyright file, and adding GPL3 license to root dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.3
2
 
import Unity.Screens 0.1
3
 
 
4
 
Instantiator {
5
 
    id: root
6
 
 
7
 
    property var screens: Screens{}
8
 
 
9
 
    model: screens
10
 
    ScreenWindow {
11
 
        id: window
12
 
        visible: true
13
 
        screen: model.screen
14
 
        Shell{ anchors.fill: parent }
15
 
        Component.onCompleted: {
16
 
            print("Window created for Screen", screen, screen.geometry, outputType, Screens.HDMIA, screen.devicePixelRatio)
17
 
        }
18
 
        Component.onDestruction: {
19
 
            print("Window destroyed")
20
 
        }
21
 
        onScaleChanged: print("NOTICE: scale changed for", model.screen, "to", scale);
22
 
        onFormFactorChanged: print("NOTICE: form factor changed for", model.screen, "to", formFactor)
23
 
        Button {
24
 
            anchors { left: parent.left; bottom: parent.bottom }
25
 
            height: 100
26
 
            width: parent.width / 2
27
 
            text: "Scale up"
28
 
            onClicked: window.setScaleAndFormFactor(window.scale + 0.2, Screens.FormFactorMonitor)
29
 
        }
30
 
        Button {
31
 
            anchors { right: parent.right; bottom: parent.bottom }
32
 
            height: 100
33
 
            width: parent.width / 2
34
 
            text: "Scale down"
35
 
            onClicked: window.setScaleAndFormFactor(window.scale - 0.2, Screens.FormFactorTablet)
36
 
        }
37
 
    }
38
 
}