From 1d2566765d4e2512fbf690dfaa49b6ed8d24c98a Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Mon, 3 Dec 2012 21:41:12 +0900 Subject: [PATCH] Define minimum width/height of the tab bar and restore it on the startup (so, if you accidentaly get too narrow tab bar, it will be fixed in the next startup: workaround for #380) --- modules/base.js | 2 ++ modules/browser.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/base.js b/modules/base.js index 1c0566fe..1efbfde5 100644 --- a/modules/base.js +++ b/modules/base.js @@ -243,6 +243,8 @@ var TreeStyleTabBase = { MAX_TABBAR_SIZE_RATIO : 0.8, DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67, + MIN_TABBAR_WIDTH : 24, + MIN_TABBAR_HEIGHT : 24, /* base variables */ baseIndentVertical : 12, diff --git a/modules/browser.js b/modules/browser.js index c1826cdd..28606862 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -610,7 +610,7 @@ TreeStyleTabBrowser.prototype = { let key = this.autoHide.expanded ? 'tabbar.width' : 'tabbar.shrunkenWidth' ; let width = utils.getTreePref(key); - let minWidth = this.scrollBox.boxObject.width + let minWidth = Math.max(this.MIN_TABBAR_WIDTH, this.scrollBox.boxObject.width); if (minWidth > width) { this.setPrefForActiveWindow(function() { utils.setTreePref(key, minWidth); @@ -620,7 +620,7 @@ TreeStyleTabBrowser.prototype = { } else { let height = utils.getTreePref('tabbar.height'); - let minHeight = this.scrollBox.boxObject.height + let minHeight = Math.max(this.MIN_TABBAR_HEIGHT, this.scrollBox.boxObject.height); if (minHeight > height) { this.setPrefForActiveWindow(function() { utils.setTreePref('tabbar.height', minHeight);