Index: sources/gui/qml/KeyboardItem.qml =================================================================== diff -u -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 -r5b9ff6266f7ca8ae9bbd5eace92d6454359791db --- sources/gui/qml/KeyboardItem.qml (.../KeyboardItem.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) +++ sources/gui/qml/KeyboardItem.qml (.../KeyboardItem.qml) (revision 5b9ff6266f7ca8ae9bbd5eace92d6454359791db) @@ -23,38 +23,66 @@ // Qml imports import "qrc:/globals" +import "qrc:/dialogs" +import VAlarmStatus 0.1 /*! * \brief Keyboard is the single keyboard in the entire applicaiton. */ + + +// Issues: +// Reduce the keyboard buttons size +// Show the notification-bar at the bottom with the keyboard +// +// 1. A background is added +// 2. The keyboard is ancherd to the background with the 20% reduced ratio +// 3. The function determineYPos() is used to calculate the height for the keyboard with notification-bar at the bottom +// InputPanel { id : _root + + VAlarmStatus { id: vAlarmStatus } + function setVisible(vVisible) { - Qt.inputMethod.show() visible = vVisible + + if(visible) { + Qt.inputMethod.show() + } } + function determineYPos() { + let ySize = parent.height - _root.height + + if (vAlarmStatus.hasAlarm && _alarmBar.visible) + ySize -= Variables.notificationHeight / 2 + + return ySize + } + + active : false // if active set to true then in the TextInput section handlers will show up, which is not nice. externalLanguageSwitchEnabled: true - active : false // if active set to true then in the TextInput section handlers will show up, which is not nice. - y : Qt.inputMethod.visible ? parent.height - _root.height - _bottomFiller.height : parent.height - anchors.left : parent.left - anchors.right : parent.right + + anchors.horizontalCenter : parent.horizontalCenter + y : Qt.inputMethod.visible ? determineYPos() : parent.height + width : (parent.width * 0.8) Behavior on y { NumberAnimation { duration: Variables.keybardAnimationDuration } } - // when an alarm is active then alarm covers the keyboard - // to avoid that keyboard moved a little higher - // because the keyboard height is calculated by InputPanel itself and can not be set, - // a gap beetween the bottom of the keyboard and the screen. - // the rectangle _bottomFiller is to fill that gap - Rectangle { id: _bottomFiller - height: Variables.minVGap - color: "black" // InputPanel background color. - anchors.left: _root.left - anchors.right: _root.right - anchors.top: _root.bottom + + Rectangle { id: _background + visible : Qt.inputMethod.visible + y : 0 + z : -1 + width : Variables.applicationWidth + height : _root.height + anchors.horizontalCenter: _root.horizontalCenter + color : "black" } + Component.onCompleted: { VirtualKeyboardSettings.locale = "en_US"; console.log("Default keyboard locale set to : " + VirtualKeyboardSettings.locale) } } +