From 551ce8d8093a9b978cdfa78f1c43ce6dd5caa423 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Mon, 30 Nov 2015 01:44:24 +0900 Subject: [PATCH] Disallow to enlarge the width of the tab bar over a half of the window --- modules/window.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/window.js b/modules/window.js index 866a890b..d9b15ddb 100644 --- a/modules/window.js +++ b/modules/window.js @@ -1009,9 +1009,15 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, { ReferenceCounter.add('currentTarget,mousemove,TSTWindow,false'); var b = this.getTabBrowserFromChild(aEvent.currentTarget); - var box = aEvent.currentTarget.id == 'treestyletab-tabbar-resizer-splitter' ? - this.getTabStrip(b) : - b.treeStyleTab.tabStripPlaceHolder || b.tabContainer ; + var box; + if (aEvent.currentTarget.id == 'treestyletab-tabbar-resizer-splitter') { + box = this.getTabStrip(b); + } + else { + box = b.treeStyleTab.tabStripPlaceHolder || b.tabContainer; + } + b.treeStyleTab.tabStripPlaceHolder.setAttribute('maxwidth', b.boxObject.width * this.MAX_TABBAR_SIZE_RATIO); + this.tabbarResizeStartWidth = box.boxObject.width; this.tabbarResizeStartHeight = box.boxObject.height; this.tabbarResizeStartX = aEvent.screenX; @@ -1044,6 +1050,7 @@ TreeStyleTabWindow.prototype = inherit(TreeStyleTabBase, { catch(e) { this.defaultErrorHandler(e); } + b.treeStyleTab.tabStripPlaceHolder.removeAttribute('maxwidth'); }).bind(this), 0); }, onTabbarResizing : function TSTWindow_onTabbarResizing(aEvent)