起動直後にタブバーのサイズが極端に小さくなってしまう問題を修正

タブバーの幅や高さがウィンドウの大きさを超えないようにした


git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6609 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-04-22 09:05:15 +00:00
parent 16724cb93a
commit bae827ac24
2 changed files with 6 additions and 14 deletions

View File

@ -112,25 +112,15 @@ var TreeStyleTabService = {
maxTabbarWidth : function TSTService_maxTabbarWidth(aWidth, aTabBrowser) maxTabbarWidth : function TSTService_maxTabbarWidth(aWidth, aTabBrowser)
{ {
aTabBrowser = aTabBrowser || this.browser; aTabBrowser = aTabBrowser || this.browser;
return Math.min( var max = Math.max(window.outerWidth, parseInt(document.documentElement.getAttribute('width') || 0));
aWidth, return Math.min(aWidth, max * 0.7);
parseInt(Math.min(
Math.max(window.outerWidth, parseInt(document.documentElement.getAttribute('width'))),
aTabBrowser.boxObject.width
) * 0.9)
);
}, },
maxTabbarHeight : function TSTService_maxTabbarHeight(aHeight, aTabBrowser) maxTabbarHeight : function TSTService_maxTabbarHeight(aHeight, aTabBrowser)
{ {
aTabBrowser = aTabBrowser || this.browser; aTabBrowser = aTabBrowser || this.browser;
return Math.min( var max = Math.max(window.outerHeight, parseInt(document.documentElement.getAttribute('height') || 0));
aHeight, return Math.min(aHeight, max * 0.7);
parseInt(Math.min(
Math.max(window.outerHeight, parseInt(document.documentElement.getAttribute('height'))),
aTabBrowser.boxObject.height
) * 0.9)
);
}, },
/* Initializing */ /* Initializing */

View File

@ -1725,6 +1725,8 @@ var TreeStyleTabUtils = {
var shrunken = this.getTreePref('tabbar.shrunkenWidth'); var shrunken = this.getTreePref('tabbar.shrunkenWidth');
if (expanded <= shrunken) { if (expanded <= shrunken) {
this.tabbarWidthResetting = true; this.tabbarWidthResetting = true;
var w = this.browserWindow;
if (w) expanded = Math.min(expanded, w.outerWidth);
if (aPrefName == 'extensions.treestyletab.tabbar.width') if (aPrefName == 'extensions.treestyletab.tabbar.width')
this.setTreePref('tabbar.shrunkenWidth', parseInt(expanded / 1.5)); this.setTreePref('tabbar.shrunkenWidth', parseInt(expanded / 1.5));
else else