~mir-team/qtmir/trunk

363.4.14 by Gerry Boland
Shimmy files around to result in bzr mv qml-demo-shell.qml Shell.qml
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
434.5.25 by Gerry Boland
Edit qml-demo-shell to use newly introduced ScreenWindow type, and add manual test for scale adjustment (coming)
10
    ScreenWindow {
363.4.14 by Gerry Boland
Shimmy files around to result in bzr mv qml-demo-shell.qml Shell.qml
11
        id: window
12
        visible: true
434.5.25 by Gerry Boland
Edit qml-demo-shell to use newly introduced ScreenWindow type, and add manual test for scale adjustment (coming)
13
        screen: model.screen
363.4.14 by Gerry Boland
Shimmy files around to result in bzr mv qml-demo-shell.qml Shell.qml
14
        Shell{ anchors.fill: parent }
15
        Component.onCompleted: {
434.5.25 by Gerry Boland
Edit qml-demo-shell to use newly introduced ScreenWindow type, and add manual test for scale adjustment (coming)
16
            print("Window created for Screen", screen, screen.geometry, outputType, Screens.HDMIA, screen.devicePixelRatio)
17
        }
18
        Component.onDestruction: {
19
            print("Window destroyed")
20
        }
434.5.31 by Gerry Boland
Add formFactor support, shell can now set it and clients receive it
21
        onScaleChanged: print("NOTICE: scale changed for", model.screen, "to", scale);
22
        onFormFactorChanged: print("NOTICE: form factor changed for", model.screen, "to", formFactor)
434.5.25 by Gerry Boland
Edit qml-demo-shell to use newly introduced ScreenWindow type, and add manual test for scale adjustment (coming)
23
        Button {
24
            anchors { left: parent.left; bottom: parent.bottom }
25
            height: 100
26
            width: parent.width / 2
27
            text: "Scale up"
434.5.31 by Gerry Boland
Add formFactor support, shell can now set it and clients receive it
28
            onClicked: window.setScaleAndFormFactor(window.scale + 0.2, Screens.FormFactorMonitor)
434.5.25 by Gerry Boland
Edit qml-demo-shell to use newly introduced ScreenWindow type, and add manual test for scale adjustment (coming)
29
        }
30
        Button {
31
            anchors { right: parent.right; bottom: parent.bottom }
32
            height: 100
33
            width: parent.width / 2
34
            text: "Scale down"
434.5.31 by Gerry Boland
Add formFactor support, shell can now set it and clients receive it
35
            onClicked: window.setScaleAndFormFactor(window.scale - 0.2, Screens.FormFactorTablet)
363.4.14 by Gerry Boland
Shimmy files around to result in bzr mv qml-demo-shell.qml Shell.qml
36
        }
37
    }
38
}