~thomas-moenicke/phablet-extras/maliit-plugins-0.99-server

« back to all changes in this revision

Viewing changes to nemo-keyboard/nemo-keyboard.qml

  • Committer: Thomas Moenicke
  • Date: 2012-11-21 15:19:50 UTC
  • mto: This revision was merged to the branch mainline in revision 2086.
  • Revision ID: thomas.moenicke@canonical.com-20121121151950-vwz3ilncpu0r4rjj
* merging 
* New release 
* New release

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import QtQuick 2.0
33
33
import org.nemomobile 1.0
34
34
 
35
 
Rectangle {
 
35
Item {
36
36
    id: canvas
37
37
    transformOrigin: Item.Center
38
38
    width: MInputMethodQuick.screenWidth
39
39
    height: MInputMethodQuick.screenHeight
40
 
    color: "transparent"
41
 
    opacity: 1
42
40
 
43
 
    Rectangle {
 
41
    Item {
44
42
        id: root
45
43
        transformOrigin: Item.Center
46
 
        color: "transparent"
47
 
        opacity: 1
48
 
 
49
 
        PluginClose {
50
 
            LandscapeVKB {
 
44
        width: parent.width
 
45
        height: parent.height
 
46
 
 
47
        KeyboardBase {
 
48
            id: keyboard
 
49
            width: layout ? layout.width : 0
 
50
            height: layout ? layout.height : 0
 
51
            anchors.bottom: parent.bottom
 
52
            anchors.horizontalCenter: parent.horizontalCenter
 
53
 
 
54
            EnglishLandscape {
51
55
                id: vkb_landscape
52
 
                anchors.bottom: parent.bottom
53
 
                anchors.horizontalCenter: parent.horizontalCenter
 
56
                visible: keyboard.layout == vkb_landscape
54
57
            }
55
58
 
56
 
            PortraitVKB {
 
59
            EnglishPortrait {
57
60
                id: vkb_portrait
58
 
                anchors.bottom: parent.bottom
59
 
                anchors.horizontalCenter: parent.horizontalCenter
 
61
                visible: keyboard.layout == vkb_portrait
60
62
            }
61
63
        }
62
64
 
67
69
    }
68
70
 
69
71
    focus: true
70
 
    state: MInputMethodQuick.appOrientation
 
72
 
 
73
    function updateIMArea() {
 
74
        var x = 0, y = 0, width = 0, height = 0;
 
75
        var angle = MInputMethodQuick.appOrientation;
 
76
 
 
77
        switch (angle) {
 
78
        case 0:
 
79
            y = MInputMethodQuick.screenHeight - vkb_landscape.height;
 
80
        case 180:
 
81
            x = (MInputMethodQuick.screenWidth - vkb_landscape.width) / 2;
 
82
            width = vkb_landscape.width;
 
83
            height = vkb_landscape.height;
 
84
            break;
 
85
 
 
86
        case 270:
 
87
            x = MInputMethodQuick.screenWidth - vkb_portrait.height;
 
88
        case 90:
 
89
            y = (MInputMethodQuick.screenHeight - vkb_portrait.width) / 2;
 
90
            width = vkb_portrait.height;
 
91
            height = vkb_portrait.width;
 
92
            break;
 
93
        }
 
94
 
 
95
        MInputMethodQuick.setInputMethodArea(Qt.rect(x, y, width, height));
 
96
    }
71
97
 
72
98
    states: [
73
99
        State {
 
100
<<<<<<< TREE
74
101
            name: "0"
 
102
=======
 
103
            name: "landscape"
 
104
            when: MInputMethodQuick.appOrientation == 0 || MInputMethodQuick.appOrientation == 180
 
105
>>>>>>> MERGE-SOURCE
75
106
 
76
107
            StateChangeScript {
 
108
<<<<<<< TREE
77
109
                script: MInputMethodQuick.setInputMethodArea(
78
110
                    Qt.rect((MInputMethodQuick.screenWidth - vkb_landscape.width) / 2,
79
111
                            MInputMethodQuick.screenHeight - vkb_landscape.height,
80
112
                            vkb_landscape.width, vkb_landscape.height))
 
113
=======
 
114
                script: updateIMArea();
 
115
>>>>>>> MERGE-SOURCE
81
116
            }
82
117
 
83
118
            PropertyChanges {
84
119
                target: root
 
120
<<<<<<< TREE
85
121
                rotation: 0
 
122
=======
 
123
                rotation: MInputMethodQuick.appOrientation
 
124
                x: 0
 
125
                y: 0
 
126
>>>>>>> MERGE-SOURCE
86
127
                width: parent.width
87
128
                height: parent.height
 
129
<<<<<<< TREE
88
130
                x: 0
89
131
                y: 0
90
132
            }
97
139
            PropertyChanges {
98
140
                target: vkb_landscape;
99
141
                opacity: 1
 
142
=======
 
143
            }
 
144
 
 
145
            PropertyChanges {
 
146
                target: keyboard
 
147
                layout: vkb_landscape
 
148
>>>>>>> MERGE-SOURCE
100
149
            }
101
150
        },
102
151
 
103
152
        State {
 
153
<<<<<<< TREE
104
154
            name: "90"
 
155
=======
 
156
            name: "portrait"
 
157
            when: MInputMethodQuick.appOrientation == 90 || MInputMethodQuick.appOrientation == 270
 
158
>>>>>>> MERGE-SOURCE
105
159
 
106
160
            StateChangeScript {
 
161
<<<<<<< TREE
107
162
                script: MInputMethodQuick.setInputMethodArea(
108
163
                    Qt.rect(0, (MInputMethodQuick.screenHeight - vkb_portrait.width) / 2,
109
164
                            vkb_portrait.height, vkb_portrait.width))
 
165
=======
 
166
                script: updateIMArea();
 
167
>>>>>>> MERGE-SOURCE
110
168
            }
111
169
 
112
170
            PropertyChanges {
113
171
                target: root
 
172
<<<<<<< TREE
114
173
                rotation: 90
 
174
=======
 
175
                rotation: MInputMethodQuick.appOrientation
 
176
                x: (parent.width - parent.height) / 2
 
177
                y: (parent.height - parent.width) / 2
 
178
>>>>>>> MERGE-SOURCE
115
179
                width: parent.height
116
180
                height: parent.width
 
181
<<<<<<< TREE
117
182
                x: (parent.width - parent.height) / 2
118
183
                y: (parent.height - parent.width) / 2
119
184
            }
208
273
        }
209
274
    ]
210
275
 
 
276
=======
 
277
            }
 
278
 
 
279
            PropertyChanges {
 
280
                target: keyboard
 
281
                layout: vkb_portrait
 
282
            }
 
283
        }
 
284
    ]
 
285
>>>>>>> MERGE-SOURCE
211
286
}
212
287