Selaa lähdekoodia

Merge pull request #6241 from TrevorDev/virtualKeyboard

make virtual keyboard visible
David Catuhe 6 vuotta sitten
vanhempi
commit
2b7b86ea4f
2 muutettua tiedostoa jossa 10 lisäystä ja 1 poistoa
  1. 1 0
      dist/preview release/what's new.md
  2. 9 1
      gui/src/2D/controls/virtualKeyboard.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -237,6 +237,7 @@
 - Add error eventlistener (bubbling up the onError callback chain) in case an `EquiRectangularCubeTexture` cannot be loaded, because of a wrong path or IO problems ([Dennis Dervisis](https://github.com/ddervisis))
 - 3D GUI buttons no longer will scale up when pressing with a multitouch device ([TrevorDev](https://github.com/TrevorDev))
 - 2D GUI elements will use the last clicked controller instead of only the right controller when dual VR controllers are interacting with an element ([TrevorDev](https://github.com/TrevorDev))
+- Virtual keyboard not showing up when made visible ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

+ 9 - 1
gui/src/2D/controls/virtualKeyboard.ts

@@ -110,6 +110,7 @@ export class VirtualKeyboard extends StackPanel {
         panel.isVertical = false;
         panel.isFocusInvisible = true;
 
+        var maxKey: Nullable<Button> = null;
         for (var i = 0; i < keys.length; i++) {
             let properties = null;
 
@@ -117,9 +118,16 @@ export class VirtualKeyboard extends StackPanel {
                 properties = propertySets[i];
             }
 
-            panel.addControl(this._createKey(keys[i], properties));
+            var key = this._createKey(keys[i], properties);
+            if (!maxKey || key.heightInPixels > maxKey.heightInPixels) {
+                maxKey = key;
+            }
+
+            panel.addControl(key);
         }
 
+        panel.height = maxKey ? maxKey.height : this.defaultButtonHeight;
+
         this.addControl(panel);
     }