Changeset f53dc3


Ignore:
Timestamp:
Feb 28, 2009, 2:17:09 AM (11 years ago)
Author:
rene <rene@…>
Branches:
lite_0.1, multiEdit, ng_0.6, ng_0.6_help, ng_0.8, ng_0.9
Children:
292d78
Parents:
b3cd32
Message:

optimized layout, has to be rechecked

Location:
chrome
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/v_identity.xml

    rb3cd32 rf53dc3  
    114114        <xul:image class="menupopup_clone-icon" xbl:inherits="src"/>
    115115        <xul:label class="menupopup_clone-text" xbl:inherits="value=label,accesskey,crop" crop="right" flex="1"/>
    116         <xul:label value="&vident.accPane.prettyName.prefix;" class="menupopup_clone-description virtIdLabel" vid="false" xbl:inherits="vid" crop="right"/>
     116        <xul:label value="&vident.accPane.prettyName.prefix;" class="menupopup_clone-vid virtIdLabel" vid="false" xbl:inherits="vid" crop="right"/>
    117117            <xul:label class="menupopup_clone-description" xbl:inherits="value=description" crop="right"/>
     118        <xul:label class="menupopup_clone-smtp" xbl:inherits="value=smtp,style=smtpStyle" crop="right"/>
    118119    </content>
    119120    <implementation>
     
    127128
    128129        this.description = this._identityDataStorage.sideDescription;
     130        this.smtp = this._identityDataStorage.smtp.value;
     131        this.smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
     132        this._identityDataStorage.smtp.value;
    129133       
    130134        document.getElementById("vI_tooltipPopupset").addTooltip(this, true);
     
    148152    <property name="value" onget="return this.getAttribute('value');" onset="this.setAttribute('value', val); return val;" />
    149153    <property name="description" onget="return this.getAttribute('description');" onset="this.setAttribute('description', val); return val;" />
     154    <property name="smtp" onget="return this.getAttribute('smtp');" onset="this.setAttribute('smtp', val); return val;" />
     155    <property name="smtpStyle" onget="return this.getAttribute('smtpStyle');" onset="this.setAttribute('smtpStyle', val); return val;" />
    150156    </implementation>
    151157    </binding>
     
    165171            <body><![CDATA[
    166172        var listitem = document.createElement("menuitem");
     173        listitem.setAttribute("class", "menuitem-non-iconic");
     174        listitem.setAttribute("type", "non-iconic-noaccel");
    167175        listitem.setAttribute("label", document.getElementById("bundle_messenger").getString("defaultServerTag"));
    168176        this._smtpPopup.appendChild(listitem);
     
    175183        if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) {
    176184            var listitem = document.createElement("menuitem");
     185            listitem.setAttribute("class", "menuitem-non-iconic");
     186            listitem.setAttribute("type", "non-iconic-noaccel");
    177187            listitem.setAttribute("label", (server.description?server.description:server.hostname));
    178188            listitem.setAttribute("key", server.key);
     
    196206                this._addServer(servers.QueryElementAt(i, Components.interfaces.nsISmtpServer));
    197207       
    198         this._prefroot.addObserver("extensions.virtualIdentity.show_smtp", this._observer, false);
    199         this._observer.observe();
    200208        ]]>
    201209    </constructor>
    202     <destructor>
    203         <![CDATA[
    204         this._prefroot.removeObserver("extensions.virtualIdentity.show_smtp", this._observer);
    205         ]]>
    206     </destructor>
    207210    <property name="smtp" onget="return this._smtpMenu.selectedItem.getAttribute('key');" >
    208211        <setter><![CDATA[
     
    219222        ]]></setter>
    220223    </property>
    221     <field name="_observer"><![CDATA[({
    222         _self: this,
    223             observe: function(aSubject, aTopic, aPrefName) {
    224             if (this._self._prefroot)
    225                 this._self.showSmtp =
    226                 this._self._prefroot.getBoolPref("extensions.virtualIdentity.show_smtp")
    227         }
    228         })]]></field>
    229     <property name="showSmtp" onget="return (this.getAttribute('showSmtp') == 'true');" onset="this.setAttribute('showSmtp',val?'true':'false'); return val;" />
    230     <field name="_prefroot">Components.classes["@mozilla.org/preferences-service;1"]
    231             .getService(Components.interfaces.nsIPrefService)
    232             .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2)</field>
    233224    <field name="_smtpPopup">document.getAnonymousElementByAttribute(this, "anonid", "smtp_server_list_popup")</field>
    234225    <field name="_smtpMenu">document.getAnonymousElementByAttribute(this, "anonid", "smtpServerMenuList")</field>
     
    260251            <xul:vbox><xul:spacer flex="1" />
    261252                <xul:hbox>
    262                     <xul:label value="&vident.accPane.prettyName.prefix;" class="menu_clone-description virtIdLabel" xbl:inherits="vid" crop="right"/>
     253                    <xul:label id="msgIdentity_base_id_label" class="menu_clone-description" xbl:inherits="value,hidden=base_id_key_hidden" crop="right" hidden="true"/>
     254                    <xul:label value="&vident.accPane.prettyName.prefix;" class="menu_clone-vid virtIdLabel" xbl:inherits="vid" crop="right"/>
    263255                    <xul:label id="msgIdentity_clone_label" class="menu_clone-description" xbl:inherits="value=description" crop="right"/>
    264                     <xul:label id="msgIdentity_base_id_label" class="menu_clone-description" xbl:inherits="value,hidden=base_id_key_hidden" crop="right" hidden="true"/>
    265256                </xul:hbox>
    266257            <xul:spacer flex="1" /></xul:vbox>
     
    281272        // it will be done in v_identity.js init
    282273        // document.getElementById("vI_tooltipPopupset").addTooltip(this, false);
     274       
     275        this._prefroot.addObserver("extensions.virtualIdentity.show_smtp", this._observer, false);
     276        this._observer.observe();
    283277        ]]>
    284278    </constructor>
     
    287281        document.getElementById("vI_tooltipPopupset")
    288282            .removeTooltip(this.tooltipElem.getAttribute("tooltip"));
     283        this._prefroot.removeObserver("extensions.virtualIdentity.show_smtp", this._observer);
    289284        ]]>
    290285    </destructor>
     
    514509    <field name="tooltipElem">document.getAnonymousElementByAttribute(this, "anonid", "contentHBox")</field>
    515510    <field name="textBoxElem">document.getAnonymousElementByAttribute(this, "anonid", "textBox");</field>
     511    <field name="_prefroot">Components.classes["@mozilla.org/preferences-service;1"]
     512        .getService(Components.interfaces.nsIPrefService)
     513        .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2)</field>
     514    <field name="_observer"><![CDATA[({
     515        _self: this,
     516            observe: function(aSubject, aTopic, aPrefName) {
     517            if (this._self._prefroot)
     518                this._self.showSmtp =
     519                this._self._prefroot.getBoolPref("extensions.virtualIdentity.show_smtp");
     520                var MenuItems = this._self._popupElem.childNodes;
     521                for (var j = 0; j < MenuItems.length; j++) {
     522                    if (MenuItems[j].localName == "menuseparator") continue;
     523                    MenuItems[j].smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
     524                }
     525        }
     526        })]]></field>
    516527    <property name="email" onset="this.identityData.email = val; this.label = this.identityData.combinedName; this.inputEvent()" />
    517528    <property name="vid" onget="return (this.getAttribute('vid') == 'true');" onset="this.setAttribute('vid',val?'true':'false'); return val;" />
     
    520531    <property name="extras" onget="return this.identityData.extras;" />
    521532    <property name="description" onget="return this.getAttribute('description');" onset="this.setAttribute('description', val); return val;" />
     533    <property name="showSmtp" onget="return (this.getAttribute('showSmtp') == 'true');" onset="this.setAttribute('showSmtp',val?'true':'false'); return val;" />
    522534    </implementation>
    523535    </binding>
  • chrome/skin/classic/v_identity/v_identity.css

    rb3cd32 rf53dc3  
    134134.identity_clone-menulist .smtpServerMenuList {
    135135  -moz-appearance: textfield;
    136   margin: 0px;
     136  margin: -2px -1px;
    137137  border: 1px solid;
    138138  padding: 0px;
     
    142142}
    143143
     144.identity_clone-menulist .smtpServerMenuList .menulist-label-box {
     145    margin: -1px;
     146}
     147
     148.identity_clone-menulist .smtpServerMenuList .menuitem-non-iconic {
     149    padding: 0;
     150}
     151
    144152.identity_clone-menulist .smtpServerMenuList .menuitem-label {
    145   text-align:   center;
     153    text-align: center;
    146154}
    147155
     
    150158}
    151159
    152 .identity_clone-menulist [showSmtp="false"] .smtpServerMenuList {
     160.identity_clone-menulist[showSmtp="false"] .smtpServerMenuList, .identity_clone-menulist[showSmtp="false"] .menupopup_clone-smtp {
    153161    display: none;
    154162}
     
    182190
    183191.menulist_clone-icon {
    184     margin:     0 3px;
     192    margin:     -2px 0pt -2px 3px;
    185193}
    186194
     
    203211}
    204212
     213.menu_clone-vid, .menupopup_clone-vid {
     214    margin:     0 5px 0 0;
     215    font-style: italic;
     216    color:      graytext;
     217}
     218
     219.menupopup_clone-vid {
     220    margin: 0;
     221    padding-left: 0;
     222}
    205223.menupopup_clone-description, .menu_clone-description {
    206224    margin:     0 5px 0 0;
     
    209227}
    210228
     229.menupopup_clone-description {
     230    margin:     0 2px 0 0;
     231    padding-right:  0;
     232}
     233
     234.menupopup_clone-smtp {
     235    margin: 1px 0pt 1px 4px;
     236    text-align: center;
     237    color: graytext;
     238}
     239
    211240.identity_clone-menulist[vid="true"], .identity_clone-popup-item[vid="true"] {
    212241  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar-small.png");
     
    215244
    216245.identity_clone-menulist[vid="false"], .identity_clone-popup-item[vid="false"] {
    217   margin: 0 3px;
    218246  list-style-image: url("chrome://messenger/skin/addressbook/icons/abcard.png");
    219247}
Note: See TracChangeset for help on using the changeset viewer.