<?xml version="1.0"?>
<!-- -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- -->
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % displayDTD SYSTEM "chrome://messenger/locale/preferences/display.dtd" >
%brandDTD;
%displayDTD;
]>

<overlay id="DisplayPaneOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <prefpane id="paneDisplay" onpaneload="gDisplayPane.init();">
    <script type="application/javascript"
            src="chrome://mozapps/content/preferences/fontbuilder.js"/>
    <script type="application/javascript"
            src="chrome://messenger/content/preferences/display.js"/>

    <preferences id="displayPreferences">
      <preference id="mail.preferences.display.selectedTabIndex" name="mail.preferences.display.selectedTabIndex" type="int"/>
      <preference id="mail.fixed_width_messages" name="mail.fixed_width_messages" type="bool"/>
      <preference id="mail.quoted_style" name="mail.quoted_style" type="int"/>
      <preference id="mail.quoted_size" name="mail.quoted_size" type="int"/>
      <preference id="mail.citation_color" name="mail.citation_color" type="string"/>
      <preference id="mail.display_glyph" name="mail.display_glyph" type="bool"/>
      <preference id="mailnews.labels.description.1" name="mailnews.labels.description.1" type="wstring"/>
      <preference id="mailnews.labels.color.1" name="mailnews.labels.color.1" type="string"/>
      <preference id="mailnews.labels.description.2" name="mailnews.labels.description.2" type="wstring"/>
      <preference id="mailnews.labels.color.2" name="mailnews.labels.color.2" type="string"/>
      <preference id="mailnews.labels.description.3" name="mailnews.labels.description.3" type="wstring"/>
      <preference id="mailnews.labels.color.3" name="mailnews.labels.color.3" type="string"/>
      <preference id="mailnews.labels.description.4" name="mailnews.labels.description.4" type="wstring"/>
      <preference id="mailnews.labels.color.4" name="mailnews.labels.color.4" type="string"/>
      <preference id="mailnews.labels.description.5" name="mailnews.labels.description.5" type="wstring"/>
      <preference id="mailnews.labels.color.5" name="mailnews.labels.color.5" type="string"/>

      <!-- FONTS -->
      <preference id="font.language.group" name="font.language.group"
                  type="wstring" onchange="gDisplayPane._rebuildFonts();"/>
    </preferences>

    <tabbox id="displayPrefs" flex="1" onselect="gDisplayPane.tabSelectionChanged();">
      <tabs>
        <tab id="formattingTab" label="&itemFormatting.label;"/>
        <tab id="tagTab" label="&itemTags.label;"/>
      </tabs>

      <tabpanels flex="1">

        <tabpanel orient="vertical">
          <!-- Fonts and Colors -->
          <groupbox id="fontsGroup">
            <caption label="&fontsAndColors1.label;"/>

            <grid id="fontsGrid">
              <columns>
                <column flex="1"/>
                <column/>
              </columns>
              <rows id="fontsRows">
                <row id="fontRow">
                  <hbox align="center">
                    <label accesskey="&defaultFont.accesskey;"
                           control="defaultFont">&defaultFont.label;</label>
                    <menulist id="defaultFont" flex="1" sizetopopup="false"
                              onsyncfrompreference="return gDisplayPane.readFontSelection()"/>
                    <label accesskey="&defaultSize.accesskey;"
                           control="defaultFontSize">&defaultSize.label;</label>
                    <menulist id="defaultFontSize">
                      <menupopup>
                        <menuitem value="9" label="9"/>
                        <menuitem value="10" label="10"/>
                        <menuitem value="11" label="11"/>
                        <menuitem value="12" label="12"/>
                        <menuitem value="13" label="13"/>
                        <menuitem value="14" label="14"/>
                        <menuitem value="15" label="15"/>
                        <menuitem value="16" label="16"/>
                        <menuitem value="17" label="17"/>
                        <menuitem value="18" label="18"/>
                        <menuitem value="20" label="20"/>
                        <menuitem value="22" label="22"/>
                        <menuitem value="24" label="24"/>
                        <menuitem value="26" label="26"/>
                        <menuitem value="28" label="28"/>
                        <menuitem value="30" label="30"/>
                        <menuitem value="32" label="32"/>
                        <menuitem value="34" label="34"/>
                        <menuitem value="36" label="36"/>
                        <menuitem value="40" label="40"/>
                        <menuitem value="44" label="44"/>
                        <menuitem value="48" label="48"/>
                        <menuitem value="56" label="56"/>
                        <menuitem value="64" label="64"/>
                        <menuitem value="72" label="72"/>
                      </menupopup>
                    </menulist>
                  </hbox>
                  <spacer style="width: 15px"/>
                  <button id="advancedFonts" label="&fontOptions.label;"
                          icon="select-font" accesskey="&fontOptions.accesskey;"
                          oncommand="gDisplayPane.configureFonts();"/>
                </row>
                <row id="colorsRow">
                  <hbox/>
                  <spacer style="width: 15px"/>
                  <button id="colors" icon="select-color"
                          label="&colorButton.label;"
                          accesskey="&colorButton.accesskey;"
                          oncommand="gDisplayPane.configureColors();"/>
                </row>
              </rows>
            </grid>
          </groupbox>

          <groupbox>
            <checkbox id="displayGlyph" label="&convertEmoticons.label;"
                      preference="mail.display_glyph" accesskey="&convertEmoticons.accesskey;"/>
            <caption label="&displayWidth.label;"/>

            <separator class="thin"/>

            <label control="displayText">&displayText.label;</label>
            <hbox id="displayText" class="indent" align="center" role="group">
              <label value="&style.label;" accesskey="&style.accesskey;" control="mailQuotedStyle"/>
              <menulist id="mailQuotedStyle" preference="mail.quoted_style">
                <menupopup>
                  <menuitem value="0" label="&regularStyle.label;"/>
                  <menuitem value="1" label="&bold.label;"/>
                  <menuitem value="2" label="&italic.label;"/>
                  <menuitem value="3" label="&boldItalic.label;"/>
                </menupopup>
              </menulist>
              <label value="&size.label;" accesskey="&size.accesskey;" control="mailQuotedSize"/>
              <menulist id="mailQuotedSize" preference="mail.quoted_size">
                <menupopup>
                  <menuitem value="0" label="&regularSize.label;"/>
                  <menuitem value="1" label="&bigger.label;"/>
                  <menuitem value="2" label="&smaller.label;"/>
                </menupopup>
              </menulist>
              <label value="&quotedTextColor.label;" accesskey="&quotedTextColor.accesskey;" control="citationmenu"/>
              <colorpicker type="button" id="citationmenu" palettename="standard" preference="mail.citation_color"/>
            </hbox>
          </groupbox>

        </tabpanel>

        <tabpanel orient="vertical">
          <label control="tagList">&displayTagsText.label;</label>
          <hbox>
            <listbox id="tagList" flex="1" rows="10" ondblclick="gDisplayPane.editTag();"/>
            <vbox>
              <button label="&addTagButton.label;" accesskey="&addTagButton.accesskey;"
                      oncommand="gDisplayPane.addTag();"/>
              <button label="&editTagButton.label;" accesskey="&editTagButton.accesskey;"
                      oncommand="gDisplayPane.editTag();"/>
              <button label="&removeTagButton.label;" accesskey="&removeTagButton.accesskey;"
                      oncommand="gDisplayPane.removeTag();"/>
            </vbox>
          </hbox>
        </tabpanel>
      </tabpanels>
    </tabbox>
    <separator/>
  </prefpane>
</overlay>
