Bug 645725 - Don't require two taps to open non-fullscreen Android keyboards [r=mfinkle]

This commit is contained in:
Matt Brubeck 2011-06-02 09:32:12 -07:00
Родитель 01bbe1fa34
Коммит c348a058a4
1 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -297,8 +297,8 @@ var BrowserUI = {
if (this._activePanel)
this._activePanel.close();
// The readOnly state of the field enabled/disabled the VKB
let isReadOnly = !(aPanel == AllPagesList && Util.isPortrait() && (willShowPanel || !this._edit.readOnly));
// If the keyboard will cover the full screen, we do not want to show it right away.
let isReadOnly = (aPanel != AllPagesList || this._isKeyboardFullscreen() || (!willShowPanel && this._edit.readOnly));
this._edit.readOnly = isReadOnly;
if (isReadOnly)
this._edit.blur();
@ -355,6 +355,24 @@ var BrowserUI = {
this._dispatchPopupChanged(false);
},
// Will the on-screen keyboard cover the whole screen when opened?
_isKeyboardFullscreen: function _isKeyboardFullscreen() {
#ifdef ANDROID
if (!Util.isPortrait()) {
switch (Services.prefs.getIntPref("widget.ime.android.landscape_fullscreen")) {
case 1:
return true;
case -1: {
let threshold = Services.prefs.getIntPref("widget.ime.android.fullscreen_threshold");
let dpi = Util.getWindowUtils(window).displayDPI;
return (window.innerHeight * 100 < threshold * dpi);
}
}
}
#endif
return false;
},
_dispatchPopupChanged: function _dispatchPopupChanged(aVisible) {
let stack = document.getElementById("stack");
let event = document.createEvent("UIEvents");