mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-1170: Use separately-declared key widths.
This commit is contained in:
		| @@ -307,7 +307,7 @@ Guacamole.OnScreenKeyboard = function(layout) { | ||||
|      * | ||||
|      * @type Guacamole.OnScreenKeyboard.Layout | ||||
|      */ | ||||
|     this.layout = layout; | ||||
|     this.layout = new Guacamole.OnScreenKeyboard.Layout(layout); | ||||
|  | ||||
|     /** | ||||
|      * Returns the element containing the entire on-screen keyboard. | ||||
| @@ -569,7 +569,7 @@ Guacamole.OnScreenKeyboard = function(layout) { | ||||
|  | ||||
|             // Add key to DOM, maintain scale | ||||
|             div.appendChild(keyElement); | ||||
|             scaledElements.push(new ScaledElement(div, 1 /* TODO: Pull from layout */, 1, true)); | ||||
|             scaledElements.push(new ScaledElement(div, osk.layout.keyWidth[object] || 1, 1, true)); | ||||
|  | ||||
|         } // end if object is key name | ||||
|  | ||||
| @@ -642,6 +642,16 @@ Guacamole.OnScreenKeyboard.Layout = function(template) { | ||||
|      */ | ||||
|     this.width = template.width; | ||||
|  | ||||
|     /** | ||||
|      * The width of each key, in arbitrary units, relative to other keys in | ||||
|      * this layout. The true pixel size of each key will be determined by the | ||||
|      * overall size of the keyboard. If not defined here, the width of each | ||||
|      * key will default to 1. | ||||
|      * | ||||
|      * @type Object.<String, Number> | ||||
|      */ | ||||
|     this.keyWidth = template.keyWidth || {}; | ||||
|  | ||||
| }; | ||||
|  | ||||
| /** | ||||
| @@ -727,13 +737,4 @@ Guacamole.OnScreenKeyboard.Key = function(template, name) { | ||||
|      */ | ||||
|     this.requires = template.requires || []; | ||||
|  | ||||
|     /** | ||||
|      * The width of this key, in arbitrary units, relative to other keys in the | ||||
|      * same layout. The true pixel size of this key will be determined by the | ||||
|      * overall size of the keyboard. By default, this will be 1. | ||||
|      * | ||||
|      * @type Number | ||||
|      */ | ||||
|     this.width = template.width || 1; | ||||
|  | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user