[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbutton/master] Bug 13650: Clip window height to 1000px (configurable)



commit 1f4436524793eb7321ac2cfafacb5c2ea8485790
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date:   Thu Mar 19 18:54:26 2015 -0700

    Bug 13650: Clip window height to 1000px (configurable)
    
    1000px was chosen based on the cutoff for vertical display users from the data
    in: https://trac.torproject.org/projects/tor/ticket/13025#comment:17
---
 src/chrome/content/torbutton.js         |   12 ++++++++----
 src/defaults/preferences/preferences.js |    3 +++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 09d6080..7084584 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -3452,16 +3452,20 @@ var torbutton_resizelistener =
       try {
         width = m_tb_prefs.getIntPref("extensions.torbutton.window.innerWidth");
       } catch(e) {
-        if (maxWidth > 1000) {
-          width = 1000;
-        } else {
-          width = Math.floor(maxWidth/200.0)*200;
+        let cappedWidth = m_tb_prefs.getIntPref("extensions.torbutton.window.maxWidth");
+        if (maxWidth > cappedWidth) {
+          maxWidth = cappedWidth;
         }
+        width = Math.floor(maxWidth/200.0)*200;
       }
 
       try {
         height = m_tb_prefs.getIntPref("extensions.torbutton.window.innerHeight");
       } catch(e) {
+        let cappedHeight = m_tb_prefs.getIntPref("extensions.torbutton.window.maxHeight");
+        if (maxHeight > cappedHeight) {
+          maxHeight = cappedHeight;
+        }
         height = Math.floor(maxHeight/100.0)*100;
       }
 
diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js
index fb1a702..e1686c4 100644
--- a/src/defaults/preferences/preferences.js
+++ b/src/defaults/preferences/preferences.js
@@ -227,3 +227,6 @@ pref("extensions.torbutton.confirm_newnym", true);
 // Browser home page, and spell checker dictionary:
 pref("browser.startup.homepage", "chrome://torbutton/locale/browser.properties");
 pref("spellchecker.dictionary", "chrome://torbutton/locale/browser.properties");
+
+pref("extensions.torbutton.window.maxHeight", 1000);
+pref("extensions.torbutton.window.maxWidth", 1000);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits