Merge pull request #6795 from keymanapp/fix/web/cherry/6783-constrained-keytips

fix(web): key preview styling, positioning issues 🍒
This commit is contained in:
Joshua Horton 2022-06-21 07:37:41 +07:00 • committed by GitHub
commit 9876d0c304
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -78,7 +78,8 @@ namespace com.keyman.osk.browser {
let canvasWidth = xWidth + Math.ceil(xWidth * 0.3) * 2;
let canvasHeight = Math.ceil(2.3 * xHeight) + (ySubPixelPadding); //
kts.top = Math.floor(y - canvasHeight) + 'px';
kts.top = 'auto';
kts.bottom = Math.floor(keyman.osk.computedHeight - y) + 'px';
kts.textAlign = 'center';
kts.overflow = 'visible';
kts.fontFamily = util.getStyleValue(kc,'font-family');

View file

@ -402,6 +402,13 @@ div.android div.kmw-keytip-tip {
background: #999;
}
div.android div.kmw-keytip-cap {
position: absolute;
background: #999;
border-radius: 0 0 5px 5px;
border-bottom: solid 1px #8a8d90
}
/* Dark mode - ensure text is colored appropriately for key tips. */
@media (prefers-color-scheme: dark) {
div.ios div.kmw-keytip {