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:
parent
2fdf574251
commit
1d2566765d
@ -243,6 +243,8 @@ var TreeStyleTabBase = {
|
|||||||
|
|
||||||
MAX_TABBAR_SIZE_RATIO : 0.8,
|
MAX_TABBAR_SIZE_RATIO : 0.8,
|
||||||
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
|
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
|
||||||
|
MIN_TABBAR_WIDTH : 24,
|
||||||
|
MIN_TABBAR_HEIGHT : 24,
|
||||||
|
|
||||||
/* base variables */
|
/* base variables */
|
||||||
baseIndentVertical : 12,
|
baseIndentVertical : 12,
|
||||||
|
@ -610,7 +610,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
let key = this.autoHide.expanded ?
|
let key = this.autoHide.expanded ?
|
||||||
'tabbar.width' : 'tabbar.shrunkenWidth' ;
|
'tabbar.width' : 'tabbar.shrunkenWidth' ;
|
||||||
let width = utils.getTreePref(key);
|
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) {
|
if (minWidth > width) {
|
||||||
this.setPrefForActiveWindow(function() {
|
this.setPrefForActiveWindow(function() {
|
||||||
utils.setTreePref(key, minWidth);
|
utils.setTreePref(key, minWidth);
|
||||||
@ -620,7 +620,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let height = utils.getTreePref('tabbar.height');
|
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) {
|
if (minHeight > height) {
|
||||||
this.setPrefForActiveWindow(function() {
|
this.setPrefForActiveWindow(function() {
|
||||||
utils.setTreePref('tabbar.height', minHeight);
|
utils.setTreePref('tabbar.height', minHeight);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user