ツリーの開閉ボタンをポイントした時、ツールチップやアイコンの変化でフィードバックを行うようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1652 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2007-11-30 19:22:34 +00:00
parent ff7e6720bd
commit e4a9315e9b
11 changed files with 79 additions and 6 deletions

View File

@ -6,6 +6,7 @@ var TreeStyleTabService = {
kINSERT_BEFORE : 'treestyletab-insert-before',
kSUBTREE_COLLAPSED : 'treestyletab-subtree-collapsed',
kCOLLAPSED : 'treestyletab-collapsed',
kTWISTY_HOVER : 'treestyletab-twisty-hover',
kNEST : 'treestyletab-nest',
kDROP_POSITION : 'treestyletab-drop-position',
kTABBAR_POSITION : 'treestyletab-tabbar-position',
@ -25,6 +26,7 @@ var TreeStyleTabService = {
kCOUNTER : 'treestyletab-counter',
kCOUNTER_CONTAINER : 'treestyletab-counter-container',
kSPLITTER : 'treestyletab-splitter',
kSTRINGBUNDLE : 'treestyletab-stringbundle',
kMENUITEM_REMOVESUBTREE_SELECTION : 'multipletab-selection-item-removeTabSubTree',
@ -106,6 +108,14 @@ var TreeStyleTabService = {
return this._XULAppInfo;
},
_XULAppInfo : null,
get stringbundle() {
if (!this._stringbundle) {
this._stringbundle = document.getElementById(this.kSTRINGBUNDLE);
}
return this._stringbundle;
},
_stringbundle : null,
/* API */

View File

@ -29,6 +29,11 @@
oncommand="TreeStyleTabService.removeTabSubTree(MultipleTabService.getSelectedTabs());"/>
</menupopup>
<stringbundleset id="stringbundleset">
<stringbundle id="treestyletab-stringbundle"
src="chrome://treestyletab/locale/treestyletab.properties"/>
</stringbundleset>
<window id="main-window">
<data id="multipletab-tabcontext-menu-template" collapsed="true">
<menuitem id="context-item-removeTabSubTree"

View File

@ -93,6 +93,8 @@ TreeStyleTabBrowser.prototype = {
b.mStrip.addEventListener('dragexit', this, false);
b.mStrip.addEventListener('dragover', this, false);
b.mStrip.addEventListener('dragdrop', this, false);
b.mTabContainer.addEventListener('mouseover', this, true);
b.mTabContainer.addEventListener('mouseout', this, true);
b.mTabContainer.addEventListener('click', this, true);
b.mTabContainer.addEventListener('dblclick', this, true);
b.mTabContainer.addEventListener('mousedown', this, true);
@ -296,6 +298,27 @@ TreeStyleTabBrowser.prototype = {
)
);
eval('b.createTooltip = '+
b.createTooltip.toSource().replace(
'if (tn.hasAttribute("label")) {',
<><![CDATA[
else if (tn.getAttribute(TreeStyleTabService.kTWISTY_HOVER) == 'true') {
var key = tn.getAttribute(TreeStyleTabService.kSUBTREE_COLLAPSED) == 'true' ? 'tooltip.expandSubtree' : 'tooltip.collapseSubtree' ;
event.target.setAttribute(
'label',
tn.hasAttribute('label') ?
TreeStyleTabService.stringbundle.getFormattedString(
key+'.labeled',
[tn.getAttribute('label')]
) :
TreeStyleTabService.stringbundle.getString(key)
);
return true;
}
$&]]></>
)
);
var tabs = b.mTabContainer.childNodes;
for (var i = 0, maxi = tabs.length; i < maxi; i++)
{
@ -925,6 +948,18 @@ TreeStyleTabBrowser.prototype = {
case 'dragdrop':
nsDragAndDrop.drop(aEvent, this);
return;
case 'mouseover':
if (this.isEventFiredOnTwisty(aEvent)) {
aEvent.target.setAttribute(this.kTWISTY_HOVER, true);
}
return;
case 'mouseout':
if (this.isEventFiredOnTwisty(aEvent)) {
aEvent.target.removeAttribute(this.kTWISTY_HOVER);
}
return;
}
},

View File

@ -5,10 +5,10 @@
<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="treestyletab@piro.sakura.ne.jp"
em:name="Tree Style Tab"
em:version="0.5.2007113001"
em:version="0.5.2007120101"
em:creator="SHIMODA Hiroshi"
em:description="Show tabs like a tree."
em:homepageURL="http://piro.sakura.ne.jp/xul/treestyletab/"
em:homepageURL="http://piro.sakura.ne.jp/xul/_treestyletab.html.en"
em:iconURL="chrome://treestyletab/content/res/icon32.png"
em:optionsURL="chrome://treestyletab/content/config.xul">
<em:translator>Godai71.Extenzilla (it-IT locale)</em:translator>
@ -26,7 +26,8 @@
<em:localized>
<RDF:Description em:locale="ja"
em:name="ツリー型タブ"
em:description="タブをツリー状に表示します。"/>
em:description="タブをツリー状に表示します。"
em:homepageURL="http://piro.sakura.ne.jp/xul/_treestyletab.html"/>
</em:localized>
<em:localized>
<RDF:Description em:locale="it-IT"

View File

@ -1,2 +1,7 @@
extensions.treestyletab@piro.sakura.ne.jp.name=Tree Style Tab
extensions.treestyletab@piro.sakura.ne.jp.description=Show tabs like a tree.
tooltip.collapseSubtree=Collapse Tree
tooltip.collapseSubtree.labeled=Collapse Tree ( %S )
tooltip.expandSubtree=Expand Tree
tooltip.expandSubtree.labeled=Expand Tree ( %S )

View File

@ -1,2 +1,7 @@
extensions.treestyletab@piro.sakura.ne.jp.name=Tree Style Tab
extensions.treestyletab@piro.sakura.ne.jp.description=Permette di visualizzare la barra delle schede in forma di albero
tooltip.collapseSubtree=Contrai tutti
tooltip.collapseSubtree.labeled=Contrai tutti ( %S )
tooltip.expandSubtree=Espandi tutti
tooltip.expandSubtree.labeled=Espandi tutti ( %S )

View File

@ -1,2 +1,7 @@
extensions.treestyletab@piro.sakura.ne.jp.name=ツリー型タブ
extensions.treestyletab@piro.sakura.ne.jp.description=タブをツリー状に表示します。
tooltip.collapseSubtree=ツリーをたたむ
tooltip.collapseSubtree.labeled=ツリーをたたむ( %S
tooltip.expandSubtree=ツリーを展開する
tooltip.expandSubtree.labeled=ツリーを展開する( %S

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

View File

@ -264,11 +264,18 @@ tabbrowser:not([treestyletab-mode="vertical"])[treestyletab-allow-subtree-collap
}
.treestyletab-twisty {
list-style-image: url("tree-twisty-expanded.png");
list-style-image: url("tree-twisty.png");
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[treestyletab-subtree-collapsed="true"] .treestyletab-twisty {
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[treestyletab-subtree-collapsed="true"] .treestyletab-twisty {
list-style-image: url("tree-twisty-collapsed.png");
.tabbrowser-tab[treestyletab-twisty-hover="true"] .treestyletab-twisty {
-moz-image-region: rect(16px, 32px, 32px, 16px);
}
.tabbrowser-tab[treestyletab-subtree-collapsed="true"][treestyletab-twisty-hover="true"] .treestyletab-twisty {
-moz-image-region: rect(16px, 16px, 32px, 0);
}
.treestyletab-counter-container {