Cheat styling to get suggestions to appear

This commit is contained in:
Darcy Wong 2019-04-02 17:09:37 +07:00
parent f8697640c5
commit df0af522f0
2 changed files with 11 additions and 6 deletions

View file

@ -209,11 +209,13 @@ namespace com.keyman.osk {
let device = util.device;
let oskManager = com.keyman.singleton.osk;
let width: number;
if (device.formFactor != 'desktop') {
ts.width = Math.floor(oskManager.getWidth() / SuggestionBanner.SUGGESTION_LIMIT) + 'px';
width = Math.floor(oskManager.getWidth() / SuggestionBanner.SUGGESTION_LIMIT);
} else {
ts.width = Math.floor(oskManager.getWidthFromCookie() / SuggestionBanner.SUGGESTION_LIMIT) + 'px';
width = Math.floor(oskManager.getWidthFromCookie() / SuggestionBanner.SUGGESTION_LIMIT);
}
ts.width = width + 'px';
let keyboardManager = (<KeymanBase>window['keyman']).keyboardManager;
if(keyboardManager.isRTL()) {
@ -223,10 +225,12 @@ namespace com.keyman.osk {
// Finalize the suggestion text
var d=util._CreateElement('div'), ds=d.style;
let suggestionIndex: String = spec.id.substr(-1);
let suggestionIndex: string = spec.id.substr(-1);
d.id = 'kmw-suggestion-text-' + suggestionIndex;
d.className = 'kmw-suggestion-text';
d.innerHTML = suggestionText;
//ds.left = (parseInt(suggestionIndex, 10) * width) + 'px';
ds.top = oskManager.getBannerHeight() - 48 + 'px';
t.appendChild(d);
return t;

View file

@ -65,9 +65,10 @@
.phone.android .kmw-key.kmw-spacebar.kmw-key-touched {background-color: #bbb;}
.phone.android .kmw-spacebar-caption {color: #aaa;}
.phone.android .kmw-banner-bar {background-color: #222; height: 100%; width: 100%;}
.phone.android .kmw-banner-bar span {background-color: #333; display:inline-block; vertical-align: middle;}
.phone.android .kmw-suggestion-text {color:#ffff; background-color: #222; position: relative; text-align: center;}
.phone.android .kmw-banner-bar {background-color: #222; display: inline-block; height: 100%; width: 100%;}
.phone.android .kmw-banner-bar span {background-color: #333; display:inline-block; text-align: center}
.phone.android .kmw-suggestion-text {color:#ffff; background-color: #222; display: inline; height: 100%;
line-height: normal; position: relative; vertical-align: middle}
.tablet.kmw-osk-frame{position:fixed;left:0;bottom:0;width:100%;height:144px;overflow-y:visible;
background-color:rgba(0,0,0,0.8);-webkit-user-select:none;}