mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-23 08:07:40 +00:00
change(web): adds a bit of dynamic resizing to help bubble
This commit is contained in:
parent
6e3a7baeac
commit
87fc6921af
1 changed files with 12 additions and 1 deletions
|
|
@ -83,7 +83,14 @@ namespace com.keyman.osk.embedded {
|
|||
|
||||
// Width dimensions must be set explicitly to prevent clipping.
|
||||
// We'll assume that the globe key is always positioned on the bottom row.
|
||||
let bubbleWidth = xWidth + Math.ceil(xWidth * 1) * 2;
|
||||
let oskBaseFontSize = new ParsedLengthStyle(keyman.osk.baseFontSize);
|
||||
let bubbleWidth = Math.ceil(xWidth * 3);
|
||||
|
||||
// The base OSK font-size is typically set in 'em', and we want to scale up
|
||||
// the bubble accordingly for devices where it'd display too small otherwise.
|
||||
if(!oskBaseFontSize.absolute) {
|
||||
bubbleWidth *= oskBaseFontSize.val;
|
||||
}
|
||||
|
||||
bubbleStyle.bottom = Math.floor(keyman.osk.computedHeight - y) + 'px';
|
||||
// CSS already defines transform: translateX(-50%) - this centers the element.
|
||||
|
|
@ -112,6 +119,10 @@ namespace com.keyman.osk.embedded {
|
|||
this.tip.style.transform = 'translateX(-' + (xOverflow - rightEdgeMargin + 1) + 'px)';
|
||||
}
|
||||
|
||||
if(!oskBaseFontSize.absolute) {
|
||||
this.element.style.fontSize = keyman.osk.baseFontSize;
|
||||
}
|
||||
|
||||
let capHeight = xHeight / 3;
|
||||
|
||||
this.cap.style.bottom = (rrow.height - capHeight) + 'px';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue