Merge branch 'master' of github.com:piroor/treestyletab

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-03-26 01:04:24 +09:00
commit 8144d29a79
16 changed files with 109 additions and 21 deletions

View File

@ -49,6 +49,9 @@
<preference id="extensions.treestyletab.tabbar.invertClosebox"
name="extensions.treestyletab.tabbar.invertClosebox"
type="bool"/>
<preference id="extensions.treestyletab.tabbar.narrowScrollbar"
name="extensions.treestyletab.tabbar.narrowScrollbar"
type="bool"/>
<preference id="extensions.treestyletab.tabbar.invertTab"
name="extensions.treestyletab.tabbar.invertTab"
type="bool"/>
@ -115,6 +118,9 @@
label="&config.tabbar.invertClosebox.left;"
label-left="&config.tabbar.invertClosebox.left;"
label-right="&config.tabbar.invertClosebox.right;"/>
<checkbox id="extensions.treestyletab.tabbar.narrowScrollbar-check"
preference="extensions.treestyletab.tabbar.narrowScrollbar"
label="&config.tabbar.narrowScrollbar;"/>
</hbox>
<hbox align="center">
<checkbox id="extensions.treestyletab.allowSubtreeCollapseExpand.horizontal-check"

View File

@ -298,6 +298,19 @@ tabs.tabbrowser-tabs[treestyletab-tabbar-position="left"]
}
tabs.tabbrowser-tabs[treestyletab-tabbar-position="left"][treestyletab-invert-scrollbar="true"]
.tabbrowser-arrowscrollbox
> scrollbox {
direction: rtl;
}
tabs.tabbrowser-tabs[treestyletab-tabbar-position="left"][treestyletab-invert-scrollbar="true"]
.tabbrowser-arrowscrollbox
> scrollbox
> .scrollbox-innerbox {
direction: ltr;
}
/* animation effects */
.tabbrowser-tabs[treestyletab-animation-enabled="true"][treestyletab-mode="vertical"]:not([treestyletab-tab-inverted="true"])

View File

@ -442,6 +442,8 @@ TreeStyleTabBrowser.prototype = {
this.onPrefChange('extensions.treestyletab.tabbar.invertTabContents');
this.onPrefChange('extensions.treestyletab.tabbar.invertClosebox');
this.onPrefChange('extensions.treestyletab.tabbar.autoShow.mousemove');
this.onPrefChange('extensions.treestyletab.tabbar.invertScrollbar');
this.onPrefChange('extensions.treestyletab.tabbar.narrowScrollbar');
this.onPrefChange('extensions.treestyletab.animation.enabled');
this.ObserverService.addObserver(this, this.kTOPIC_INDENT_MODIFIED, false);
@ -2039,6 +2041,11 @@ TreeStyleTabBrowser.prototype = {
}
return;
case 'extensions.treestyletab.tabbar.invertScrollbar':
return this.setTabbrowserAttribute(this.kINVERT_SCROLLBAR, value);
case 'extensions.treestyletab.tabbar.narrowScrollbar':
return this.setTabbrowserAttribute(this.kNARROW_SCROLLBAR, value);
case 'extensions.treestyletab.maxTreeLevel.phisical':
if (this.maxTreeLevelPhisical = value)
this.promoteTooDeepLevelTabs();

View File

@ -15,6 +15,9 @@ pref("extensions.treestyletab.tabbar.scroll.smooth", true);
pref("extensions.treestyletab.tabbar.scroll.duration", 250);
// 0 = no scroll, 1 = scroll to new tab only when the current tab will not scrolled out, 2 = scroll to new tab always
pref("extensions.treestyletab.tabbar.scrollToNewTab.mode", 1);
pref("extensions.treestyletab.tabbar.invertScrollbar", true);
pref("extensions.treestyletab.tabbar.narrowScrollbar", true);
pref("extensions.treestyletab.tabbar.narrowScrollbar.size", "0.8em");
// flat, mixed, vertigo
// pref("extensions.treestyletab.tabbar.style", "mixed");
pref("extensions.treestyletab.platform.default.tabbar.style", "mixed");

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Schließen-Button in jedem Tab rechts anzeigen">
<!ENTITY config.tabbar.invertTab "Tabs von rechts einrücken">
<!ENTITY config.tabbar.invertTabContents "Symbol und Text in den Tabs vertauschen">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Tabs einrücken">
<!ENTITY config.maxTreeLevel.before "bis">
<!ENTITY config.maxTreeLevel.after "Level">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Show closebox at rightside in each tab">
<!ENTITY config.tabbar.invertTab "Invert tab appearance">
<!ENTITY config.tabbar.invertTabContents "Invert tab contents">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Indent tabs">
<!ENTITY config.maxTreeLevel.before "until">
<!ENTITY config.maxTreeLevel.after "level(s)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Mostrar la caja de cierre del lado derecho en cada pestaña">
<!ENTITY config.tabbar.invertTab "Invertir apariencia de la pestaña">
<!ENTITY config.tabbar.invertTabContents "Invertir contenido de la pestaña">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Añadir margen a las pestañas">
<!ENTITY config.maxTreeLevel.before "hasta">
<!ENTITY config.maxTreeLevel.after "nivel(es)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Case de fermeture sur le côté droit de chaque onglet">
<!ENTITY config.tabbar.invertTab "Inverser l'apparence des onglets">
<!ENTITY config.tabbar.invertTabContents "Inverser le contenu des onglets">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Indenter les onglets">
<!ENTITY config.maxTreeLevel.before "until">
<!ENTITY config.maxTreeLevel.after "level(s)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Visualizza il pulsante di chiusura alla destra di ogni scheda"> <!-- NUOVA -->
<!ENTITY config.tabbar.invertTab "Inverti la visualizzazione delle schede">
<!ENTITY config.tabbar.invertTabContents "Inverti la visualizzazione dei controlli di contrazione/espansione dei sottoalberi"> <!-- NUOVA -->
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Indenta sottoschede">
<!ENTITY config.maxTreeLevel.before "until">
<!ENTITY config.maxTreeLevel.after "level(s)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "タブのクローズボックスを右に表示">
<!ENTITY config.tabbar.invertTab "タブの表示を左右反転">
<!ENTITY config.tabbar.invertTabContents "タブの内容を左右反転">
<!ENTITY config.tabbar.narrowScrollbar "スクロールバーの幅を細くする">
<!ENTITY config.enableSubtreeIndent "ツリーをインデント表示する">
<!ENTITY config.maxTreeLevel.before "">
<!ENTITY config.maxTreeLevel.after "階層まで)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Ikona zamknięcia po prawej stronie karty">
<!ENTITY config.tabbar.invertTab "Odwróć położenie etykiet kart">
<!ENTITY config.tabbar.invertTabContents "Odwróć położenie ikon na etykiecie karty">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Stosuj wcięcia">
<!ENTITY config.maxTreeLevel.before "until">
<!ENTITY config.maxTreeLevel.after "level(s)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Показывать кнопку закрытия с правой стороны каждой вкладки">
<!ENTITY config.tabbar.invertTab "Инвертировать вид вкладок">
<!ENTITY config.tabbar.invertTabContents "Инвертировать содержимое вкладок">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Отступы вкладок">
<!ENTITY config.maxTreeLevel.before "until">
<!ENTITY config.maxTreeLevel.after "level(s)">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "Visa stängknapp på höger sida i varje flik">
<!ENTITY config.tabbar.invertTab "Invertera flikutseende">
<!ENTITY config.tabbar.invertTabContents "Invertera flikinnehåll">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "Gör indrag av flikar">
<!ENTITY config.maxTreeLevel.before "t.o.m. den">
<!ENTITY config.maxTreeLevel.after "nivån">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "在每个标签右端显示关闭按钮">
<!ENTITY config.tabbar.invertTab "反转标签外观">
<!ENTITY config.tabbar.invertTabContents "反转标签图标和文字位置">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "缩进标签">
<!ENTITY config.maxTreeLevel.before "最多">
<!ENTITY config.maxTreeLevel.after "层">

View File

@ -15,6 +15,7 @@
<!ENTITY config.tabbar.invertClosebox.right "於各分頁右端顯示關閉鈕">
<!ENTITY config.tabbar.invertTab "頁籤外側互調">
<!ENTITY config.tabbar.invertTabContents "頁籤內側互調">
<!ENTITY config.tabbar.narrowScrollbar "Narrow scrollbar">
<!ENTITY config.enableSubtreeIndent "縮進分頁">
<!ENTITY config.maxTreeLevel.before "until">
<!ENTITY config.maxTreeLevel.after "level(s)">

View File

@ -95,6 +95,8 @@ var TreeStyleTabUtils = {
kMAX_LEVEL : 'treestyletab-max-tree-level',
kPRINT_PREVIEW : 'treestyletab-print-preview',
kANIMATION_ENABLED : 'treestyletab-animation-enabled',
kINVERT_SCROLLBAR : 'treestyletab-invert-scrollbar',
kNARROW_SCROLLBAR : 'treestyletab-narrow-scrollbar',
kTAB_INVERTED : 'treestyletab-tab-inverted',
kTAB_CONTENTS_INVERTED : 'treestyletab-tab-contents-inverted',
@ -318,6 +320,7 @@ var TreeStyleTabUtils = {
this.onPrefChange('extensions.treestyletab.tabbar.scroll.smooth');
this.onPrefChange('extensions.treestyletab.tabbar.scroll.duration');
this.onPrefChange('extensions.treestyletab.tabbar.scrollToNewTab.mode');
this.onPrefChange('extensions.treestyletab.tabbar.narrowScrollbar.size');
this.onPrefChange('extensions.treestyletab.animation.enabled');
this.onPrefChange('extensions.treestyletab.animation.indent.duration');
this.onPrefChange('extensions.treestyletab.animation.collapse.duration');
@ -354,6 +357,57 @@ var TreeStyleTabUtils = {
Components.utils.import('resource://gre/modules/WindowsPreviewPerTab.jsm', ns);
this.AeroPeek = ns.AeroPeek;
},
updateNarrowScrollbarStyle : function TSTUtils_updateNarrowScrollbarStyle()
{
const SSS = Cc['@mozilla.org/content/style-sheet-service;1']
.getService(Ci.nsIStyleSheetService);
if (this.lastAgentSheet &&
SSS.sheetRegistered(this.lastAgentSheet, SSS.AGENT_SHEET))
SSS.unregisterSheet(this.lastAgentSheet, SSS.AGENT_SHEET);
const style = 'data:text/css,'+encodeURIComponent(
<![CDATA[
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
tabs.tabbrowser-tabs[%MODE%="vertical"][%NARROW%="true"]
.tabbrowser-arrowscrollbox
> scrollbox
> scrollbar[orient="vertical"],
tabs.tabbrowser-tabs[%MODE%="vertical"][%NARROW%="true"]
.tabbrowser-arrowscrollbox
> scrollbox
> scrollbar[orient="vertical"] * {
max-width: %SIZE%;
min-width: %SIZE%;
}
tabs.tabbrowser-tabs[%MODE%="vertical"][%NARROW%="true"]
.tabbrowser-arrowscrollbox
> scrollbox
> scrollbar[orient="vertical"] {
font-size: %SIZE%;
}
tabs.tabbrowser-tabs[%MODE%="vertical"][%NARROW%="true"]
.tabbrowser-arrowscrollbox
> scrollbox
> scrollbar[orient="vertical"] * {
padding-left: 0;
padding-right: 0;
margin-left: 0;
margin-right: 0;
}
]]>.toString()
.replace(/%MODE%/g, this.kMODE)
.replace(/%NARROW%/g, this.kNARROW_SCROLLBAR)
.replace(/%SIZE%/g, this.getTreePref('tabbar.narrowScrollbar.size'))
);
this.lastAgentSheet = this.makeURIFromSpec(style);
SSS.loadAndRegisterSheet(this.lastAgentSheet, SSS.AGENT_SHEET);
},
lastAgentSheet : null,
observe : function TSTUtils_observe(aSubject, aTopic, aData)
{
@ -2107,12 +2161,11 @@ var TreeStyleTabUtils = {
case 'extensions.treestyletab.indent':
this.baseIndent = value;
this.ObserverService.notifyObservers(null, this.kTOPIC_INDENT_MODIFIED, value);
break;
return;
case 'extensions.treestyletab.tabbar.width':
case 'extensions.treestyletab.tabbar.shrunkenWidth':
this.updateTabWidthPrefs(aPrefName);
break;
return this.updateTabWidthPrefs(aPrefName);
case 'browser.tabs.insertRelatedAfterCurrent':
case 'browser.tabs.loadFolderAndReplace':
@ -2138,39 +2191,34 @@ var TreeStyleTabUtils = {
this.setPref(target, this.getPref(aPrefName));
}
this.prefOverriding = false;
break;
return;
case 'extensions.treestyletab.clickOnIndentSpaces.enabled':
this.shouldDetectClickOnIndentSpaces = this.getPref(aPrefName);
break;
return this.shouldDetectClickOnIndentSpaces = this.getPref(aPrefName);
case 'extensions.treestyletab.tabbar.scroll.smooth':
this.smoothScrollEnabled = value;
break;
return this.smoothScrollEnabled = value;
case 'extensions.treestyletab.tabbar.scroll.duration':
this.smoothScrollDuration = value;
break;
return this.smoothScrollDuration = value;
case 'extensions.treestyletab.tabbar.scrollToNewTab.mode':
this.scrollToNewTabMode = value;
break;
return this.scrollToNewTabMode = value;
case 'extensions.treestyletab.tabbar.narrowScrollbar.size':
return this.updateNarrowScrollbarStyle();
case 'extensions.treestyletab.animation.enabled':
this.animationEnabled = value;
break;
return this.animationEnabled = value;
case 'extensions.treestyletab.animation.indent.duration':
this.indentDuration = value;
break;
return this.indentDuration = value;
case 'extensions.treestyletab.animation.collapse.duration':
this.collapseDuration = value;
break;
return this.collapseDuration = value;
case 'extensions.treestyletab.twisty.expandSensitiveArea':
this.shouldExpandTwistyArea = value;
break;
return this.shouldExpandTwistyArea = value;
default:
break;
return;
}
},