~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

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

  • Committer: Alan Griffiths
  • Date: 2016-11-07 17:59:19 UTC
  • mfrom: (436.1.1 miral2)
  • Revision ID: alan@octopull.co.uk-20161107175919-stbb64i7j1htgog2
[miral-qt] delete all as qtmir work on MirAL has shifted to lp:~unity-team/qtmir/miral-qt-integration and this is a needless distration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.0
2
 
import Unity.Application 0.1
3
 
 
4
 
Column {
5
 
    id: root
6
 
    width: childrenRect.width
7
 
    height: childrenRect.height
8
 
    focus: false
9
 
 
10
 
    property alias model: repeater.model
11
 
 
12
 
    function stateString(state) {
13
 
        switch(state) {
14
 
        case Mir.HiddenState:         return "Hidden"
15
 
        case Mir.RestoredState:       return "Restored"
16
 
        case Mir.MinimizedState:      return "Minimized"
17
 
        case Mir.MaximizedState:      return "Maximized"
18
 
        case Mir.VertMaximizedState:  return "VertMax"
19
 
        case Mir.FullscreenState:     return "Fullscreen"
20
 
        case Mir.HorizMaximizedState: return "HorizMax"
21
 
        case Mir.UnknownState:        return "Unknown"
22
 
        }
23
 
        return "Invalid"
24
 
    }
25
 
    function typeString(type) {
26
 
        switch(type) {
27
 
        case Mir.UnknownType:   return "Unknown"
28
 
        case Mir.NormalType:        return "Normal"
29
 
        case Mir.UtilityType:       return "Utility"
30
 
        case Mir.DialogType:        return "Dialog"
31
 
        case Mir.GlossType:         return "Gloss"
32
 
        case Mir.FreeStyleType:     return "FreeStyle"
33
 
        case Mir.MenuType:          return "Menu"
34
 
        case Mir.InputMethodType:   return "InputMethod"
35
 
        case Mir.SatelliteType:     return "Satellite"
36
 
        case Mir.TipType:           return "Tip"
37
 
        }
38
 
        return "Invalid"
39
 
    }
40
 
 
41
 
    function geometryString(surface) {
42
 
        return surface.position.x + "," + surface.position.y + " " + surface.size.width + "x" + surface.size.height
43
 
    }
44
 
 
45
 
 
46
 
    Text {
47
 
        text: "Index\t\Name\tVisible\tState\tType\tGeometry"
48
 
        height: (visible) ? implicitHeight : 0
49
 
        visible: repeater.count > 0
50
 
        color: "white"
51
 
 
52
 
        Rectangle {
53
 
            anchors.fill: parent
54
 
            color: "blue"
55
 
            z: -1
56
 
        }
57
 
    }
58
 
    Repeater {
59
 
        id: repeater
60
 
        delegate: Text {
61
 
            text: index + "\t" + surface.name + "\t" + surface.visible + "\t"
62
 
                  + stateString(surface.state) + "\t" +  typeString(surface.type) + "\t" + geometryString(surface)
63
 
            font.bold: surface.focused
64
 
 
65
 
            Rectangle {
66
 
                anchors.fill: parent
67
 
                color: (index % 2) ? "white" : "lightblue"
68
 
                z: -1
69
 
            }
70
 
        }
71
 
    }
72
 
}