Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: ui/keyboard/resources/main.js

Issue 150783002: Aligns the Q A Z keys on the a11y keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make mic smaller. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 (function(exports) { 4 (function(exports) {
5 /** 5 /**
6 * Alignment options for a keyset. 6 * Alignment options for a keyset.
7 * @param {Object=} opt_keyset The keyset to calculate the dimensions for. 7 * @param {Object=} opt_keyset The keyset to calculate the dimensions for.
8 * Defaults to the current active keyset. 8 * Defaults to the current active keyset.
9 */ 9 */
10 var AlignmentOptions = function(opt_keyset) { 10 var AlignmentOptions = function(opt_keyset) {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // All left-over pixels assigned to right most key. 448 // All left-over pixels assigned to right most key.
449 if (i == (stretch.length - 1)) 449 if (i == (stretch.length - 1))
450 stretch[i].setAttribute('bonus', bonus + extra); 450 stretch[i].setAttribute('bonus', bonus + extra);
451 else 451 else
452 stretch[i].setAttribute('bonus', bonus); 452 stretch[i].setAttribute('bonus', bonus);
453 } 453 }
454 break; 454 break;
455 case RowAlignment.CENTER: 455 case RowAlignment.CENTER:
456 xOffset += Math.floor(extra/2) 456 xOffset += Math.floor(extra/2)
457 break; 457 break;
458 case RowAlignment.JUSTIFY: 458 case RowAlignment.JUSTIFY:
bshe 2014/01/31 16:09:49 nit: doesn't look like we have a JUSTIFY in the en
rsadam 2014/01/31 16:22:29 Typo! Fixed!
459 xOffset += extra; 459 xOffset += extra;
460 break; 460 break;
461 case RowAlignment.STRETCHRIGHT:
462 all[all.length-1].setAttribute('bonus', extra);
461 default: 463 default:
462 break; 464 break;
463 }; 465 };
464 466
465 var yOffset = params.offsetTop + heightOffset; 467 var yOffset = params.offsetTop + heightOffset;
466 var left = xOffset; 468 var left = xOffset;
467 for (var i = 0; i < all.length; i++) { 469 for (var i = 0; i < all.length; i++) {
468 var key = all[i]; 470 var key = all[i];
469 var width = params.keyWidth; 471 var width = params.keyWidth;
470 if (key.weight != DEFAULT_KEY_WEIGHT_X) { 472 if (key.weight != DEFAULT_KEY_WEIGHT_X) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 var importedContent = importHTML(content); 589 var importedContent = importHTML(content);
588 expandHTML(importedContent); 590 expandHTML(importedContent);
589 return importedContent; 591 return importedContent;
590 } 592 }
591 593
592 // Prevents all default actions of touch. Keyboard should use its own gesture 594 // Prevents all default actions of touch. Keyboard should use its own gesture
593 // recognizer. 595 // recognizer.
594 addEventListener('touchstart', function(e) { e.preventDefault() }); 596 addEventListener('touchstart', function(e) { e.preventDefault() });
595 addEventListener('touchend', function(e) { e.preventDefault() }); 597 addEventListener('touchend', function(e) { e.preventDefault() });
596 addEventListener('touchmove', function(e) { e.preventDefault() }); 598 addEventListener('touchmove', function(e) { e.preventDefault() });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698