Bug 1149677 - Force minimum QR code size. r=past
authorJ. Ryan Stinnett <jryans@gmail.com>
Fri, 03 Apr 2015 06:46:00 -0400
changeset 257378 76a06f930f3b790f69e6b3d13e0e6edd4d5bc856
parent 257377 30eef7948c54753470230f8d49aeec7759a115a7
child 257379 45ed3255697c8975da916fa404ce8d067bd2924d
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1149677
milestone40.0a1
Bug 1149677 - Force minimum QR code size. r=past
browser/devtools/webide/modules/runtimes.js
--- a/browser/devtools/webide/modules/runtimes.js
+++ b/browser/devtools/webide/modules/runtimes.js
@@ -524,19 +524,22 @@ WiFiRuntime.prototype = {
       },
       onCloseWindow() {},
       onWindowTitleChange() {}
     };
     Services.wm.addListener(windowListener);
 
     // |openDialog| is typically a blocking API, so |executeSoon| to get around this
     DevToolsUtils.executeSoon(() => {
+      // Height determines the size of the QR code.  Force a minimum size to
+      // improve scanability.
+      const MIN_HEIGHT = 600;
       let win = Services.wm.getMostRecentWindow("devtools:webide");
       let width = win.outerWidth * 0.8;
-      let height = win.outerHeight * 0.5;
+      let height = Math.max(win.outerHeight * 0.5, MIN_HEIGHT);
       win.openDialog("chrome://webide/content/wifi-auth.xhtml",
                      WINDOW_ID,
                      "modal=yes,width=" + width + ",height=" + height, session);
     });
 
     return {
       close() {
         if (!promptWindow) {