From dcc5b28cea134252d884f76883ccb5df16054d59 Mon Sep 17 00:00:00 2001 From: "rflint%ryanflint.com" Date: Fri, 25 May 2007 11:08:58 +0000 Subject: [PATCH] Bug 345950 - Provide a browser.tabs.tabMaxWidth. Patch by Dao Gottwald , r=mano --- browser/app/profile/firefox.js | 1 + toolkit/content/widgets/tabbrowser.xml | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 060d0d9ff61..dcfd04ea5cd 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -251,6 +251,7 @@ pref("browser.tabs.opentabfor.middleclick", true); pref("browser.tabs.loadDivertedInBackground", false); pref("browser.tabs.loadBookmarksInBackground", false); pref("browser.tabs.tabMinWidth", 100); +pref("browser.tabs.tabMaxWidth", 250); pref("browser.tabs.tabClipWidth", 140); // Where to show tab close buttons: diff --git a/toolkit/content/widgets/tabbrowser.xml b/toolkit/content/widgets/tabbrowser.xml index 8a079b58b65..ebf72edf855 100644 --- a/toolkit/content/widgets/tabbrowser.xml +++ b/toolkit/content/widgets/tabbrowser.xml @@ -1150,7 +1150,7 @@ t.setAttribute("label", aURI); t.setAttribute("crop", "end"); - t.maxWidth = 250; + t.maxWidth = this.mTabContainer.mTabMaxWidth; t.minWidth = this.mTabContainer.mTabMinWidth; t.width = 0; t.setAttribute("flex", "100"); @@ -2663,13 +2663,23 @@ try { this.mTabMinWidth = pb2.getIntPref("browser.tabs.tabMinWidth"); - this.mTabClipWidth = pb2.getIntPref("browser.tabs.tabClipWidth"); - this.mCloseButtons = pb2.getIntPref("browser.tabs.closeButtons"); + } catch (e) { } - catch (e) { + try { + this.mTabMaxWidth = pb2.getIntPref("browser.tabs.tabMaxWidth"); + } catch (e) { + } + try { + this.mTabClipWidth = pb2.getIntPref("browser.tabs.tabClipWidth"); + } catch (e) { + } + try { + this.mCloseButtons = pb2.getIntPref("browser.tabs.closeButtons"); + } catch (e) { } this.firstChild.minWidth = this.mTabMinWidth; + this.firstChild.maxWidth = this.mTabMaxWidth; this.adjustTabstrip(); pb2.addObserver("browser.tabs.closeButtons", @@ -2752,6 +2762,7 @@ }); 100 + 250 140 1