* 「タブの一覧表示」ボタンの表示/非表示の設定を制御するチェックボックスを常に表示するようにした

* Firefox 3.5専用の項目を設定から隠すようにした


git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4166 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-04-21 06:10:26 +00:00
parent adb9adfd69
commit bb8dc24708
5 changed files with 43 additions and 32 deletions

View File

@ -55,12 +55,17 @@ function onChangeGroupBookmarkRadio()
function onChangeTabbarPosition(aOnChange)
{
const XULAppInfo = Components.classes['@mozilla.org/xre/app-info;1']
.getService(Components.interfaces.nsIXULAppInfo);
const comparator = Components.classes['@mozilla.org/xpcom/version-comparator;1']
.getService(Components.interfaces.nsIVersionComparator);
var pos = document.getElementById('extensions.treestyletab.tabbar.position-radiogroup').value;
var invertScrollbar = document.getElementById('extensions.treestyletab.tabbar.invertScrollbar-check');
invertScrollbar.disabled = pos != 'left';
document.getElementById('extensions.treestyletab.tabbar.invertUI-check').disabled = pos != 'right';
if (isGecko18()) {
if (comparator.compare(XULAppInfo.version, '3.0') < 0) {
invertScrollbar.removeAttribute('collapsed');
}
else {
@ -74,7 +79,6 @@ function onChangeTabbarPosition(aOnChange)
var collapseCheck = document.getElementById('extensions.treestyletab.allowSubtreeCollapseExpand-check');
// var autoHideCheck = document.getElementById('extensions.treestyletab.tabbar.autoHide.enabled-check');
var hideNewTabCheck = document.getElementById('extensions.treestyletab.tabbar.hideNewTabButton-check');
var hideAllTabsCheck = document.getElementById('extensions.treestyletab.tabbar.hideAlltabsButton-check');
if (aOnChange &&
gLastStateIsVertical != (pos == 'left' || pos == 'right')) {
@ -85,26 +89,20 @@ function onChangeTabbarPosition(aOnChange)
if (pos == 'left' || pos == 'right') {
indentCheck.setAttribute('collapsed', true);
// autoHideCheck.removeAttribute('collapsed');
hideNewTabCheck.removeAttribute('collapsed');
hideAllTabsCheck.removeAttribute('collapsed');
if (comparator.compare(XULAppInfo.version, '3.1b3') >= 0)
hideNewTabCheck.removeAttribute('collapsed');
else
hideNewTabCheck.setAttribute('collapsed', true);
}
else {
indentCheck.removeAttribute('collapsed');
// autoHideCheck.setAttribute('collapsed', true);
hideNewTabCheck.setAttribute('collapsed', true);
hideAllTabsCheck.setAttribute('collapsed', true);
}
gTabbarPlacePositionInitialized = true;
}
function isGecko18()
{
const XULAppInfo = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo);
var version = XULAppInfo.platformVersion.split('.');
return parseInt(version[0]) <= 1 && parseInt(version[1]) <= 8;
}
var gAutoHideModeRadio;
var gAutoHideModeToggle;

View File

@ -103,15 +103,15 @@
label="&config.allowSubtreeCollapseExpand;"/>
</hbox>
<hbox align="center">
<checkbox id="extensions.treestyletab.tabbar.hideAlltabsButton-check"
preference="extensions.treestyletab.tabbar.hideAlltabsButton"
label="&config.tabbar.hideAlltabsButton;"/>
<checkbox id="extensions.treestyletab.enableSubtreeIndent-check"
preference="extensions.treestyletab.enableSubtreeIndent"
label="&config.enableSubtreeIndent;"/>
<checkbox id="extensions.treestyletab.tabbar.hideNewTabButton-check"
preference="extensions.treestyletab.tabbar.hideNewTabButton"
label="&config.tabbar.hideNewTabButton;"/>
<checkbox id="extensions.treestyletab.tabbar.hideAlltabsButton-check"
preference="extensions.treestyletab.tabbar.hideAlltabsButton"
label="&config.tabbar.hideAlltabsButton;"/>
</hbox>
</vbox>
</groupbox>

View File

@ -27,18 +27,18 @@ tabbrowser[treestyletab-tabbar-fixed="true"] .tabbrowser-strip+splitter {
}
tabbrowser:not([treestyletab-mode="horizontal"]) .tabbrowser-arrowscrollbox > .scrollbutton-up,
tabbrowser:not([treestyletab-mode="horizontal"]) .tabbrowser-arrowscrollbox > .scrollbutton-down-stack,
tabbrowser:not([treestyletab-mode="horizontal"]) .tabbrowser-arrowscrollbox > .scrollbutton-down, /* Firefox 3 */
tabbrowser[treestyletab-mode="vertical"] .tabbrowser-arrowscrollbox > .scrollbutton-up,
tabbrowser[treestyletab-mode="vertical"] .tabbrowser-arrowscrollbox > .scrollbutton-down-stack,
tabbrowser[treestyletab-mode="vertical"] .tabbrowser-arrowscrollbox > .scrollbutton-down, /* Firefox 3 */
tabbrowser[treestyletab-hide-alltabs-button="true"] .tabs-alltabs-stack,
tabbrowser[treestyletab-hide-alltabs-button="true"] .tabbrowser-arrowscrollbox ~ stack, /* "all tabs" button in Firefox 3 and 3.1 */
tabbrowser[treestyletab-mode="vertical"] .tabs-closebutton-box,
tabbrowser:not([treestyletab-mode="horizontal"]) .tab-drop-indicator-bar,
tabbrowser:not([treestyletab-mode="horizontal"]) #vide-bar, /* Tab Mix Plus */
tabbrowser:not([treestyletab-mode="horizontal"]) #tabs-scroll-up-down-box, /* Tab Mix Plus */
tabbrowser:not([treestyletab-mode="horizontal"]) #alltabs-place-holder, /* Tab Mix Plus */
tabbrowser:not([treestyletab-mode="horizontal"]) .tabs-scroll /* Tab Mix Plus */ {
display: none !important;
tabbrowser[treestyletab-mode="vertical"] .tab-drop-indicator-bar,
tabbrowser[treestyletab-mode="vertical"] #vide-bar, /* Tab Mix Plus */
tabbrowser[treestyletab-mode="vertical"] #tabs-scroll-up-down-box, /* Tab Mix Plus */
tabbrowser[treestyletab-mode="vertical"] #alltabs-place-holder, /* Tab Mix Plus */
tabbrowser[treestyletab-mode="vertical"] .tabs-scroll /* Tab Mix Plus */ {
visibility: collapse !important;
}
#appcontent {

View File

@ -166,21 +166,35 @@ var TreeStyleTabService = {
_WindowMediator : null,
get isGecko18() {
var version = this.XULAppInfo.platformVersion.split('.');
return parseInt(version[0]) <= 1 && parseInt(version[1]) <= 8;
if (this._isGecko18 === null)
this._isGecko18 = this.Comparator.compare(this.XULAppInfo.version, '3.0') < 0;
return this._isGecko18;
},
_isGecko18 : null,
get isGecko19() {
var version = this.XULAppInfo.platformVersion.split('.');
return parseInt(version[0]) >= 2 || parseInt(version[1]) >= 9;
if (this._isGecko19 === null)
this._isGecko19 = this.Comparator.compare(this.XULAppInfo.version, '3.0') >= 0;
return this._isGecko19;
},
_isGecko19 : null,
get XULAppInfo() {
if (!this._XULAppInfo) {
this._XULAppInfo = Components.classes['@mozilla.org/xre/app-info;1'].getService(Components.interfaces.nsIXULAppInfo);
this._XULAppInfo = Components
.classes['@mozilla.org/xre/app-info;1']
.getService(Components.interfaces.nsIXULAppInfo);
}
return this._XULAppInfo;
},
_XULAppInfo : null,
get Comparator() {
if (!this._Comparator) {
this._Comparator = Components
.classes['@mozilla.org/xpcom/version-comparator;1']
.getService(Components.interfaces.nsIVersionComparator);
}
return this._Comparator;
},
_Comparator : null,
get stringbundle() {
if (!this._stringbundle) {

View File

@ -1056,8 +1056,7 @@ TreeStyleTabBrowser.prototype = {
break;
case 'extensions.treestyletab.tabbar.hideAlltabsButton':
var pos = b.getAttribute(this.kTABBAR_POSITION);
if (value && (pos == 'left' || pos == 'right'))
if (value)
b.setAttribute(this.kHIDE_ALLTABS, true);
else
b.removeAttribute(this.kHIDE_ALLTABS);