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)

This commit is contained in:
YUKI Hiroshi 2012-12-03 21:41:12 +09:00
parent 2fdf574251
commit 1d2566765d
2 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -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);