~thomas-moenicke/phablet-extras/maliit-plugins-url-layout

« back to all changes in this revision

Viewing changes to maliit-keyboard/qml/Keyboard.qml

changing the swipe-to-dismiss behavior: only the invisible area on top of the osk triggers swipe-to-dismiss, the keypad itself
is now insensitive. This should improve typing, esp. when typing fast.

Approved by Bill Filler, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        width: parent.width
69
69
        height: parent.height
70
70
 
 
71
    MouseArea {
 
72
        id: keypadMouseArea
 
73
 
 
74
        anchors {
 
75
            top: parent.top
 
76
            fill: parent
 
77
            topMargin: layout.invisible_toucharea_height;
 
78
        }
 
79
 
71
80
        Item {
72
81
            id: keyboardContainer
73
 
            x: 0
74
 
            y: layout.invisible_toucharea_height;
75
 
            width: parent.width
76
 
            height: parent.height
 
82
 
 
83
            anchors.fill: parent
77
84
 
78
85
            Rectangle {
79
86
                id: background
161
168
 
162
169
                            mouse.accepted = false;
163
170
                        }
 
171
 
 
172
                        onReleased: {
 
173
                            console.error("ON_RELEASED")
 
174
                            if (pressedKeyIndex == -1)
 
175
                                return;
 
176
 
 
177
                            if (!drag.active)
 
178
                                event_handler.onReleased(pressedKeyIndex);
 
179
 
 
180
                            event_handler.onExited(pressedKeyIndex)
 
181
                            pressedKeyIndex = -1;
 
182
 
 
183
                        }
 
184
 
164
185
                        onPressAndHold: event_handler.onPressAndHold(index)
165
186
 
166
187
                    }
219
240
        } // keyboardContainer
220
241
 
221
242
        onReleased: {
222
 
 
223
 
            if (y > jumpBackThreshold) {
224
 
                canvas.shown = false;
225
 
            } else {
226
 
                bounceBackAnimation.from = y
227
 
                bounceBackAnimation.start();
228
 
            }
229
 
 
230
243
            if (pressedKeyIndex == -1)
231
244
                return;
232
245
 
235
248
 
236
249
            event_handler.onExited(pressedKeyIndex)
237
250
            pressedKeyIndex = -1;
238
 
        }
239
 
 
240
 
        PropertyAnimation {
241
 
            id: bounceBackAnimation
242
 
            target: keyboardSurface
243
 
            properties: "y"
244
 
            easing.type: Easing.OutBounce;
245
 
            easing.overshoot: 2.0
246
 
            to: 0
247
 
        }
 
251
 
 
252
        }
 
253
    } // keypadMouseArea
 
254
 
 
255
    onReleased: {
 
256
        if (y > jumpBackThreshold) {
 
257
            canvas.shown = false;
 
258
        } else {
 
259
            bounceBackAnimation.from = y
 
260
            bounceBackAnimation.start();
 
261
        }
 
262
    }
 
263
 
 
264
    PropertyAnimation {
 
265
        id: bounceBackAnimation
 
266
        target: keyboardSurface
 
267
        properties: "y"
 
268
        easing.type: Easing.OutBounce;
 
269
        easing.overshoot: 2.0
 
270
        to: 0
 
271
    }
 
272
 
248
273
    } // big mousearea
249
 
 
250
 
    }
 
274
    } // rotation helper
251
275
 
252
276
    state: "HIDDEN"
253
277