Changeset 15021


Ignore:
Timestamp:
03/03/10 21:19:13 (2 years ago)
Author:
sam
Message:

stylage xul sc4 suite

Location:
trunk/Xul_Core/content/scenariCore/widgets/matrix
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Xul_Core/content/scenariCore/widgets/matrix/matrix.xbl.css

    r15015 r15021  
    244244} 
    245245 
     246slotTabContent .tabLabelFlags image{ 
     247        display:none; 
     248} 
     249slotTabContent[dirty] .tabLabelFlags .tabLabelFlagDirty{ 
     250        display:inline; 
     251} 
     252slotTabContent[locked] .tabLabelFlags .tabLabelFlagLocked{ 
     253        display:inline; 
     254} 
    246255/* ======================== closeBtn ======================== */  
    247256toolbarbutton.closeBtn { 
  • trunk/Xul_Core/content/scenariCore/widgets/matrix/slotContents.xbl.xml

    r15020 r15021  
    8686                                                pTab.removeAttribute("dirty"); 
    8787                                        } 
     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                                        } 
    8895                                } catch(e) { 
    8996                                        log.debug("slot.fillTab::"+e); 
     
    104111                                try { 
    105112                                        var vTab = this.fTabsContainer.firstElementChild; 
     113                                        while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 
    106114                                        while(vTab) { 
    107115                                                if( ! vTab.closeTab()) return; 
    108116                                                vTab = this.fTabsContainer.firstElementChild; 
     117                                                while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 
    109118                                        } 
    110119                                }catch(e){ 
     
    120129                                        log.info("closing all exept: "+pCurrentTab.label); 
    121130                                        var vTab = pCurrentTab.nextElementSibling; 
     131                                        while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 
    122132                                        while(vTab) { 
    123133                                                if( ! vTab.closeTab()) return; 
    124134                                                vTab = pCurrentTab.nextElementSibling; 
     135                                                while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.nextElementSibling; 
    125136                                        } 
    126137                                        vTab = pCurrentTab.previousElementSibling; 
     138                                        while(vTab && vTab.fView.getAttribute("locked")) vTab = vTab.previousElementSibling; 
    127139                                        while(vTab) { 
    128140                                                var vPrvTab = vTab.previousElementSibling; 
     141                                                while(vPrvTab && vPrvTab.fView.getAttribute("locked")) vPrvTab = vPrvTab.previousElementSibling; 
    129142                                                if( ! vTab.closeTab()) return; 
    130143                                                vTab = vPrvTab; 
     
    144157                                <children> 
    145158                                        <xul:stack> 
    146                                                 <xul:hbox class="tabLabel" align="center"> 
     159                                                <xul:hbox anonid="tabLabel" class="tabLabel" align="center"> 
    147160                                <xul:image class="tabLabelIco" xbl:inherits="src=image"/> 
    148161                                        <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> 
    149166                                                </xul:hbox> 
    150                                                 <xul:hbox class="tabTools" pack="end" align="top"> 
     167                                                <xul:hbox anonid="tabTools" class="tabTools" pack="end" align="top"> 
    151168                                                        <xul:hbox anonid="tabToolBar"> 
    152169                                                                <xul:toolbarbutton anonid="optionBtn" class="optionBtn" onmousedown="document.getBindingParent(this).showOptionMnu(this)" tooltiptext="Options..."/> 
     
    155172                                                </xul:hbox> 
    156173                                                <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"/> 
    158176                                <xul:menuitem anonid="optionMnu.closeOtherTabs" label="Fermer les autres onglets" oncommand="document.getBindingParent(this).fSlot.closeOtherTabs(document.getBindingParent(this));" tooltiptext=""/> 
    159177                                <xul:menuitem anonid="optionMnu.closeAllTabs" label="Fermer tous les onglets" oncommand="document.getBindingParent(this).fSlot.closeAllTabs();" tooltiptext=""/> 
     
    164182                <implementation> 
    165183                        <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> 
    166186                        <field name="fOptionMnuCloseOtherTabs">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu.closeOtherTabs")</field> 
    167187                        <field name="fOptionMnuCloseAllTabs">document.getAnonymousElementByAttribute(this, "anonid", "optionMnu.closeAllTabs")</field> 
     
    170190                                <body><![CDATA[ 
    171191                                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; 
    174196                                        this.fOptionMnu.openPopup(document.getAnonymousElementByAttribute(this, "anonid", "optionBtn"), 'after_start', 0, 1, true, false); 
    175197                                }catch(e){log.debug("slotTabContent.showOptionMnu : "+e);} 
    176198                                ]]></body> 
    177199                        </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> 
    178217                </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                 
    179227        </binding> 
    180228</bindings> 
Note: See TracChangeset for help on using the changeset viewer.