Added "penelope.mailbox.fixIconColumns" and "penelope.mailbox.fixIconColumns.width" hidden prefs
authorJeff Beckley <beckley@qualcomm.com>
Thu, 08 Jul 2010 17:55:44 -0700
changeset 272 f5467db341855578371e3503515026df8a1cdf73
parent 271 665b1cd16aa2913608bf690ce374aee303e13e31
child 273 1356e9b9c57991df1343e1306c315b6f61330a2e
push id257
push userbeckley@qualcomm.com
push dateFri, 09 Jul 2010 00:57:08 +0000
Added "penelope.mailbox.fixIconColumns" and "penelope.mailbox.fixIconColumns.width" hidden prefs
base/content/globalOverlay.js
base/content/messengerOverlay.js
base/content/searchDialogOverlay.js
base/prefs/all-penelope.js
--- a/base/content/globalOverlay.js
+++ b/base/content/globalOverlay.js
@@ -747,8 +747,30 @@ function enableMailboxLines()
             }
             catch(e)
             {
                 dump("Error adding css rule for line index#" +index +e+ "\n");
             }   
         }
     }
 }
+
+function updateIconColumns()
+{
+    var fix = true;
+    var width = 24;
+    try {
+        fix = gPrefBranch.getBoolPref("penelope.mailbox.fixIconColumns");
+        width = gPrefBranch.getIntPref("penelope.mailbox.fixIconColumns.width");
+    } catch (e) {}
+    
+    try {
+        var iconColumns = ["threadCol", "flaggedCol", "statusCol", "unreadButtonColHeader", "priorityCol", "attachmentCol", "junkStatusCol"];
+        
+        for (var i = 0; i < iconColumns.length; i++)
+        {
+            var col = document.getElementById(iconColumns[i]);
+            col.setAttribute("fixed", fix? "true" : "false");
+            if (fix)
+                col.setAttribute("width", width.toString());
+        }
+    } catch (e) {}
+}
--- a/base/content/messengerOverlay.js
+++ b/base/content/messengerOverlay.js
@@ -723,16 +723,17 @@ function delayedOnLoadPenelopeMessenger(
     threadTree.addEventListener("keyup",ThreadTreeOnKeyUp,true);
     
     updateMailboxFont();
     updateShowMailbox();
     gPrefBranch.QueryInterface(Components.interfaces.nsIPrefBranch2);
     gPrefBranch.addObserver("penelope.mailbox.", mailboxPrefObserver, false);
     updateMailboxCss();
     enableMailboxLines();
+    updateIconColumns();
 }
 
 var mailboxPrefObserver = 
 {
     observe: function(subject, topic, data)
     {
         switch (data)
         {
@@ -742,16 +743,20 @@ var mailboxPrefObserver =
             break;
         case "penelope.mailbox.showPreviewPane":
             if (!gIsMailboxesWindow)
                 updatePreviewPane();
             break;
         case "penelope.mailbox.selectShowsMailbox":
             updateShowMailbox();
             break;
+        case "penelope.mailbox.fixIconColumns":
+        case "penelope.mailbox.fixIconColumns.width":
+            updateIconColumns();
+            break;
         default:
             break;
         }
     }
 };
 
 function updateMailboxFont()
 {
--- a/base/content/searchDialogOverlay.js
+++ b/base/content/searchDialogOverlay.js
@@ -36,16 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function penelopeSearchOnLoad()
 {
   searchOnLoad();
   
   updateMailboxCss();
   enableMailboxLines();
+  updateIconColumns();
 }
 
 function penelopeOpenInFolderButton()
 {
   // Get the closet mail window and open up the mailbox and select the message
   // from it. It will open in a tab or a window based on the setting.
   let mailWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService()
                              .QueryInterface(Components.interfaces.nsIWindowMediator)
--- a/base/prefs/all-penelope.js
+++ b/base/prefs/all-penelope.js
@@ -100,8 +100,10 @@ pref("penelope.copyFullAddresses", true)
 pref("penelope.mailbox.columnsToPadLeft", "whoCol,senderCol,recipientCol,dateCol,receivedCol,accountCol,subjectCol");
 pref("penelope.mailbox.columnPadLeft", 20);
 pref("penelope.mailbox.columnPadLeft.subjectCol", 3);
 pref("penelope.mailbox.columnsToPadRight", "sizeCol,unreadCol,totalCol");
 pref("penelope.mailbox.columnPadRight", 3);
 pref("penelope.attachments.alwaysShowAttachBox", true);
 pref("penelope.mailbox.showLines", false);
 pref("penelope.mailbox.showLines.color", "#C0C0C0");
+pref("penelope.mailbox.fixIconColumns", true);
+pref("penelope.mailbox.fixIconColumns.width", 24);