Bug 283697 - Firefox Options (Preferences) panels are cropped (cut off). r=mconnor
authorrob_strong@exchangecode.com
Sun, 02 Sep 2007 15:05:53 -0700
changeset 5571 625d53b91e2ea55397a751d536e933f53be89081
parent 5570 a0dc65cb4fa064cbbdef016754373ccbb707565d
child 5572 ad1980ee23d59b3da58b74597f8eff1f390790f6
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconnor
bugs283697
milestone1.9a8pre
Bug 283697 - Firefox Options (Preferences) panels are cropped (cut off). r=mconnor
browser/components/preferences/preferences.xul
browser/locales/en-US/chrome/browser/preferences/preferences.dtd
browser/themes/winstripe/browser/preferences/preferences.css
toolkit/content/widgets/preferences.xml
--- a/browser/components/preferences/preferences.xul
+++ b/browser/components/preferences/preferences.xul
@@ -70,22 +70,22 @@
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
             title="&prefWindow.titleGNOME;"
 #endif
 #endif
 #endif
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 #ifdef USE_WIN_TITLE_STYLE
-            style="&prefWindow.styleWin;">
+            style="&prefWin.styleWin;">
 #else
 #ifdef XP_MACOSX
             style="&prefWindow.styleMac;">
 #else
-            style="&prefWindow.styleGNOME;">
+            style="&prefWin.styleGNOME;">
 #endif
 #endif
   
     <stringbundle id="bundlePreferences"
                   src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <prefpane id="paneMain" label="&paneMain.title;"
               src="chrome://browser/content/preferences/main.xul"/>
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.dtd
@@ -1,16 +1,16 @@
 
 <!ENTITY  prefWindow.titleWin     "Options">
 <!ENTITY  prefWindow.titleGNOME   "&brandShortName; Preferences">
 <!-- When making changes to prefWindow.styleWin test both Windows Classic and
      Luna since widget heights are different based on the OS theme -->
-<!ENTITY  prefWindow.styleWin     "width: 42em; height: 44em;">
+<!ENTITY  prefWin.styleWin        "width: 42em; min-height: 44em;">
 <!ENTITY  prefWindow.styleMac     "width: 47em;">
-<!ENTITY  prefWindow.styleGNOME   "width: 42em; height: 38.5em;">
+<!ENTITY  prefWin.styleGNOME      "width: 42em; min-height: 44.5em;">
 
 <!ENTITY  paneMain.title          "Main">
 <!ENTITY  paneTabs.title          "Tabs">
 <!ENTITY  paneContent.title       "Content">
 <!ENTITY  paneFeeds.title         "Feeds">
 <!ENTITY  panePrivacy.title       "Privacy">
 <!ENTITY  paneSecurity.title      "Security">
 <!ENTITY  paneAdvanced.title      "Advanced">
--- a/browser/themes/winstripe/browser/preferences/preferences.css
+++ b/browser/themes/winstripe/browser/preferences/preferences.css
@@ -263,10 +263,10 @@ filefield[disabled="true"] .fileFieldIco
 /* Feeds pane */
 #chooseClientAppCell {
   -moz-padding-end: 12px;
 }
 
 /* bottom-most box containing a groupbox in a prefpane. Prevents the bottom
    of the groupbox from being cutoff */
 .bottomBox {
-  padding-bottom: 2px;
+  padding-bottom: 4px;
 }
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -624,16 +624,18 @@
       <field name="instantApply">false</field>
       
       <property name="preferencePanes"
                 onget="return this.getElementsByTagName('prefpane');"/>
 
       <property name="type" onget="return this.getAttribute('type');"/>
       <property name="_paneDeck"
                 onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'paneDeck');"/>
+      <property name="_paneDeckContainer"
+                onget="return document.getAnonymousElementByAttribute(this, 'class', 'paneDeckContainer');"/>
       <property name="_selector"
                 onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'selector');"/>
       <property name="lastSelected" 
                 onget="return this.getAttribute('lastSelected');">
         <setter>
           this.setAttribute("lastSelected", val); 
           document.persist(this.id, "lastSelected");
           return val;
@@ -732,26 +734,41 @@
             if (prefpanes[i] == aPaneElement) {
               this._paneDeck.selectedIndex = i;
               
               if (this.type != "child") {
                 var oldPane = this.lastSelected ? document.getElementById(this.lastSelected) : this.preferencePanes[0];
                 oldPane.selected = !(aPaneElement.selected = true);
                 this.lastSelected = aPaneElement.id;
                 this.currentPane = aPaneElement;
-                this._initialized = true;
-
                 // Only animate if we've switched between prefpanes
                 if (this._shouldAnimate && oldPane.id != aPaneElement.id) {
                   // Don't let the new pane content flex to the current window
                   // height if we're animating 
                   aPaneElement.removeAttribute("flex");
                   aPaneElement.style.opacity = 0.0;
                   this.animate(oldPane, aPaneElement);
                 }
+                else if (this._initialized && !this._shouldAnimate) {
+                  var targetHeight = parseInt(window.getComputedStyle(this._paneDeckContainer, "").height);
+                  targetHeight -= parseInt(window.getComputedStyle(this, "").paddingTop);
+                  targetHeight -= parseInt(window.getComputedStyle(this, "").paddingBottom);
+                  if (aPaneElement.contentHeight > targetHeight) {
+                    // To workaround the bottom border of a groupbox from being
+                    // cutoff an hbox with a class of bottomBox may enclose it.
+                    // This needs to include its padding to resize properly.
+                    // See bug 394433
+                    var bottomPadding = 0;
+                    var bottomBox = aPaneElement.getElementsByAttribute("class", "bottomBox")[0];
+                    if (bottomBox)
+                      bottomPadding = parseInt(window.getComputedStyle(bottomBox, "").paddingBottom);
+                    window.innerHeight += bottomPadding + aPaneElement.contentHeight - targetHeight;
+                  }
+                }
+                this._initialized = true;
               }
               break;
             }
           }
 
           var helpButton = document.documentElement.getButton("help");
           if (aPaneElement.hasAttribute("helpURI"))
             helpButton.hidden = false;