Changeset 15021
- Timestamp:
- 03/03/10 21:19:13 (2 years ago)
- Location:
- trunk/Xul_Core/content/scenariCore/widgets/matrix
- Files:
-
- 2 added
- 2 edited
-
img/dirty-flag.png (added)
-
img/locked-flag.png (added)
-
matrix.xbl.css (modified) (1 diff)
-
slotContents.xbl.xml (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xul_Core/content/scenariCore/widgets/matrix/matrix.xbl.css
r15015 r15021 244 244 } 245 245 246 slotTabContent .tabLabelFlags image{ 247 display:none; 248 } 249 slotTabContent[dirty] .tabLabelFlags .tabLabelFlagDirty{ 250 display:inline; 251 } 252 slotTabContent[locked] .tabLabelFlags .tabLabelFlagLocked{ 253 display:inline; 254 } 246 255 /* ======================== closeBtn ======================== */ 247 256 toolbarbutton.closeBtn { -
trunk/Xul_Core/content/scenariCore/widgets/matrix/slotContents.xbl.xml
r15020 r15021 86 86 pTab.removeAttribute("dirty"); 87 87 } 88 if(pView.getAttribute("locked")=="true") { 89 pTab.setAttribute("locked", "true"); 90 if(pTab.fOptionMnuPinTab) pTab.fOptionMnuPinTab.setAttribute("checked", true); 91 } else { 92 pTab.removeAttribute("locked"); 93 if(pTab.fOptionMnuPinTab) pTab.fOptionMnuPinTab.setAttribute("checked", false); 94 } 88 95 } catch(e) { 89 96 log.debug("slot.fillTab::"+e); … … 104 111 try { 105 112 var vTab = this.fTabsContainer.firstElementChild; 113 while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 106 114 while(vTab) { 107 115 if( ! vTab.closeTab()) return; 108 116 vTab = this.fTabsContainer.firstElementChild; 117 while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 109 118 } 110 119 }catch(e){ … … 120 129 log.info("closing all exept: "+pCurrentTab.label); 121 130 var vTab = pCurrentTab.nextElementSibling; 131 while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 122 132 while(vTab) { 123 133 if( ! vTab.closeTab()) return; 124 134 vTab = pCurrentTab.nextElementSibling; 135 while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 125 136 } 126 137 vTab = pCurrentTab.previousElementSibling; 138 while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.previousElementSibling; 127 139 while(vTab) { 128 140 var vPrvTab = vTab.previousElementSibling; 141 while(vPrvTab && vPrvTab.fView.getAttribute("locked")) vPrvTab = vPrvTab.previousElementSibling; 129 142 if( ! vTab.closeTab()) return; 130 143 vTab = vPrvTab; … … 144 157 <children> 145 158 <xul:stack> 146 <xul:hbox class="tabLabel" align="center">159 <xul:hbox anonid="tabLabel" class="tabLabel" align="center"> 147 160 <xul:image class="tabLabelIco" xbl:inherits="src=image"/> 148 161 <xul:label class="tabLabelTxt small-margin" xbl:inherits="value=label" minwidth="20" crop="end"/> 162 <xul:hbox class="tabLabelFlags"> 163 <xul:image class="tabLabelFlagDirty" src="chrome://scenariCore/content/widgets/matrix/img/dirty-flag.png"/> 164 <xul:image class="tabLabelFlagLocked" src="chrome://scenariCore/content/widgets/matrix/img/locked-flag.png"/> 165 </xul:hbox> 149 166 </xul:hbox> 150 <xul:hbox class="tabTools" pack="end" align="top">167 <xul:hbox anonid="tabTools" class="tabTools" pack="end" align="top"> 151 168 <xul:hbox anonid="tabToolBar"> 152 169 <xul:toolbarbutton anonid="optionBtn" class="optionBtn" onmousedown="document.getBindingParent(this).showOptionMnu(this)" tooltiptext="Options..."/> … … 155 172 </xul:hbox> 156 173 <xul:popup anonid="optionMnu"> 157 <xul:menuitem anonid="optionMnu.closeTab" label="Fermer cet onglet" oncommand="document.getBindingParent(this).closeTab();" tooltiptext=""/> 174 <xul:menuitem anonid="optionMnu.pinTab" label="Figer cet onglet" type="checkbox" oncommand="document.getBindingParent(this).pinTab();" tooltiptext=""/> 175 <xul:menuseparator anonid="optionMnu.closeSep"/> 158 176 <xul:menuitem anonid="optionMnu.closeOtherTabs" label="Fermer les autres onglets" oncommand="document.getBindingParent(this).fSlot.closeOtherTabs(document.getBindingParent(this));" tooltiptext=""/> 159 177 <xul:menuitem anonid="optionMnu.closeAllTabs" label="Fermer tous les onglets" oncommand="document.getBindingParent(this).fSlot.closeAllTabs();" tooltiptext=""/> … … 164 182 <implementation> 165 183 <field name="fOptionMnu">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu")</field> 184 <field name="fOptionMnuPinTab">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu.pinTab")</field> 185 <field name="fOptionMnuCloseSep">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu.closeSep")</field> 166 186 <field name="fOptionMnuCloseOtherTabs">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu.closeOtherTabs")</field> 167 187 <field name="fOptionMnuCloseAllTabs">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu.closeAllTabs")</field> … … 170 190 <body><![CDATA[ 171 191 try{ 172 this.fOptionMnuCloseOtherTabs.hidden = this.fSlot.fTabsContainer.childElementCount > 1 ? false : true; 173 this.fOptionMnuCloseAllTabs.hidden = this.fSlot.fTabsContainer.childElementCount > 1 ? false : true; 192 var vHasTabs = this.fSlot.fTabsContainer.childElementCount > 1; 193 this.fOptionMnuCloseSep.hidden = !vHasTabs; 194 this.fOptionMnuCloseOtherTabs.hidden = !vHasTabs; 195 this.fOptionMnuCloseAllTabs.hidden = !vHasTabs; 174 196 this.fOptionMnu.openPopup(document.getAnonymousElementByAttribute(this, "anonid", "optionBtn"), 'after_start', 0, 1, true, false); 175 197 }catch(e){log.debug("slotTabContent.showOptionMnu : "+e);} 176 198 ]]></body> 177 199 </method> 200 <method name="pinTab"> 201 <body><![CDATA[ 202 try{ 203 var vPinned = this.fView.getAttribute("locked") || false; 204 vPinned = !vPinned; 205 this.fOptionMnuPinTab.setAttribute("checked", vPinned); 206 this.fView.setAttribute("locked", vPinned); 207 if (vPinned) { 208 this.setAttribute("locked", "true"); 209 this.fView.setAttribute("locked", "true"); 210 } else { 211 this.removeAttribute("locked"); 212 this.fView.removeAttribute("locked"); 213 } 214 }catch(e){log.debug("slotTabContent.pinTab : "+e);} 215 ]]></body> 216 </method> 178 217 </implementation> 218 <handlers> 219 <handler event="mousedown" button="2" phase="capturing"><![CDATA[ 220 if (event.originalTarget.getAttribute("anonid") == "tabTools") { 221 event.stopPropagation(); 222 this.showOptionMnu(); 223 } 224 ]]></handler> 225 </handlers> 226 179 227 </binding> 180 228 </bindings>
Note: See TracChangeset
for help on using the changeset viewer.