########## DEFINITIONS ##########
definitions:
  - &MailWindowHeaderButton
    type: Button
    button-style: toolbar-text-right
    skin-border-image: Mail Window Header Button Skin
    top-margin: 0
    bottom-margin: 0
  - &MailWindowShowMoreHeaderButton
    <<: *MailWindowHeaderButton
    name: hb_Show_More_CCHeaders
    string: S_MAIL_SHOW_MORE_CONTACTS
    hidden: true
    button-style: toolbar-image
  - &MailHeaderWrapLayout
    type: WrapLayout
    preferred-width: infinity
    hidden: true
    max-lines: 1
  - &MailHeaderLabel
    type: Label
    hidden: true
    font-weight: bold
    skin-image: Mail Window Header Label Skin
  - &MailSubjectLabel
    type: MultilineLabel
    name: hl_Subject
    preferred-width: fill
    font-rel-size: 130
    font-weight: bold
    skin-border-image: Mail Window Header Label Skin
    selectable: true
  - &MailFlagButton
    type: Button
    name: hb_FlagMessage
    string: S_MAIL_FLAG_MESSAGE
    button-style: toolbar-image
    skin-border-image: null
    action-string: Flag Message,1,,,"Mail Unflagged" | Flag Message,0,,,"Mail Flagged"
  - &MailDateLabel
    type: Label
    name: hl_Date
    selectable: true
    skin-image: Mail Window Header Label Skin
  - &MailWindowToolbarGroup
    type: Group
    name: mw_ToolbarGroup
    preferred-width: fill
  - &MailWindowBrowser
    type: Browser
    skin-image: Mail Browser Window Skin
    name: mw_mail_view
    minimum-height: 100
    minimum-width: 100
    preferred-width: 700
    preferred-height: 200
# insert definitions above
########## WIDGETS ##########
widgets:
  - type: SkinElement
    name: Mail Window Mail Message Pane
    skin-image: Mail Window Background Skin
    content:
      type: SkinElement
      name: Mail Window Background Skin Element
      skin-image: Mail Window Background Overlay
      top-margin: 0
      bottom-margin: 0
      left-margin: 0
      right-margin: 0
      dynamic-padding: true
      content:
        type: SkinElement
        name: MessagePaddedElement
        skin-image: Mail Window Message Skin
        dynamic-padding: true
        content:
          type: StackLayout
          top-margin: 0
          bottom-margin: 0
          left-margin: 0
          right-margin: 0
          orientation: vertical
          elements:
            - type: SkinElement
              name: Mail Window Toolbar And Headers
              skin-image: Mail Window Message Toolbar
              preferred-width: fill
              content:
                type: StackLayout
                orientation: vertical
                elements:
                  - type: StackLayout
                    orientation: horizontal
                    preferred-width: fill
                    elements:
                      - *MailSubjectLabel
                      - *MailDateLabel
                      - *MailFlagButton
                  - type: DynamicGridLayout
                    preferred-width: fill
                    name: CustomHeaderGrid
                    vcenter: false
                    elements:
                      - elements:
                        - type: StackLayout
                          orientation: horizontal
                          elements:
                            - type: Empty
                              preferred-width: fill
                            - <<: *MailHeaderLabel
                              name: hl_From
                              string: SI_MIME_TRANSLATE_FROM
                        - <<: *MailHeaderWrapLayout
                          name: hs_FromHeaders
                          max-lines: 0
                          elements:
                            - <<: *MailHeaderLabel
                              name: hl_Organization
                              font-weight: normal
                        - type: Empty
                      - elements:
                        - type: StackLayout
                          orientation: horizontal
                          elements:
                            - type: Empty
                              preferred-width: fill
                            - <<: *MailHeaderLabel
                              name: hl_To
                              string: SI_MIME_TRANSLATE_TO
                        - <<: *MailHeaderWrapLayout
                          name: hs_ToHeaders
                        - <<: *MailWindowShowMoreHeaderButton
                          name: hb_Show_More_ToHeaders
                          action-string: Open expand,,"hs_ToHeaders",,"Mail Show More" | Close Expand,,"hs_ToHeaders",,"Mail Hide More"
                      - elements:
                        - type: StackLayout
                          orientation: horizontal
                          elements:
                            - type: Empty
                              preferred-width: fill
                            - <<: *MailHeaderLabel
                              name: hl_CC
                              string: SI_MIME_TRANSLATE_CC
                        - <<: *MailHeaderWrapLayout
                          name: hs_CCHeaders
                        - <<: *MailWindowShowMoreHeaderButton
                          name: hb_Show_More_CCHeaders
                          action-string: Open expand,,"hs_CCHeaders",,"Mail Show More" | Close Expand,,"hs_CCHeaders",,"Mail Hide More"
                      - elements:
                        - type: StackLayout
                          orientation: horizontal
                          elements:
                            - type: Empty
                              preferred-width: fill
                            - <<: *MailHeaderLabel
                              name: hl_BCC
                              string: SI_MIME_TRANSLATE_BCC
                        - <<: *MailHeaderWrapLayout
                          name: hs_BCCHeaders
                        - <<: *MailWindowShowMoreHeaderButton
                          name: hb_Show_More_BCCHeaders
                          action-string: Open expand,,"hs_BCCHeaders",,"Mail Show More"  | Close Expand,,"hs_BCCHeaders",,"Mail Hide More"
                      - elements:
                        - type: StackLayout
                          orientation: horizontal
                          elements:
                            - type: Empty
                              preferred-width: fill
                            - <<: *MailHeaderLabel
                              name: hl_Attachments
                              string: DI_IDSTR_M2_COL_ATTACHMENTS
                        - <<: *MailHeaderWrapLayout
                          name: hs_Attachments
                          max-lines: 2
                          elements:
                            - <<: *MailWindowHeaderButton
                              name: hb_SaveAttachments
                              string: SI_SAVE_BUTTON_TEXT
                              action-string: Save attachments to folder,,,,"Save.mini"
                              hidden: true
                        - <<: *MailWindowShowMoreHeaderButton
                          name: hb_Show_More_Attachments
                          action-string: Open expand,,"hs_Attachments",,"Mail Show More"  | Close Expand,,"hs_Attachments",,"Mail Hide More"
                    template:
                      - type: StackLayout
                        orientation: horizontal
                        elements:
                          - type: Empty
                            preferred-width: fill
                          - <<: *MailHeaderLabel
                            name: CustomHeaderTitle
                            skin-border-image: Mail Window Header Button Skin
                            top-margin: 0
                            bottom-margin: 0
                            hidden: false
                      - type: MultilineLabel
                        name: CustomHeaderValue
                        skin-image: Mail Window Header Label Skin
                        left-margin: 10
                        selectable: true
                        preferred-width: infinity
                      - type: Empty
                        preferred-width: fill
            - *MailWindowToolbarGroup
            - *MailWindowBrowser
            - type: SkinElement
              name: mw_QuickReplySection
              hidden: true
              skin-image: Mail Window Quick Reply Toolbar
              content:
                type: StackLayout
                orientation: vertical
                preferred-width: fill
                elements:
                  - type: MultilineEdit
                    name: mw_QuickReplyEdit
                    preferred-width: fill
                    preferred-height: 2c
                  - type: StackLayout
                    orientation: horizontal
                    elements:
                      - type: Dropdown
                        name: mw_QuickReplyType
                        preferred-width: fill
                        minimum-width: 100
                      - type: Button
                        name: mw_QuickReplyButton
                        tab-stop: true
                        button-style: toolbar-text-right
                        action-string: Quick reply,,,,"Send mail"
                        string: DI_IDSTR_M2_MAILVIEWTOOLBAR_QUICKREPLY
  - type: SkinElement
    name: Mail Window Feed Message Pane
    skin-image: Mail Window Background Skin
    content:
      type: SkinElement
      name: Mail Window Background Skin Element
      skin-image: Mail Window Background Overlay
      top-margin: 0
      bottom-margin: 0
      left-margin: 0
      right-margin: 0
      dynamic-padding: true
      content:
        type: SkinElement
        name: MessagePaddedElement
        skin-image: Mail Window Message Skin
        dynamic-padding: true
        content:
          type: StackLayout
          top-margin: 0
          bottom-margin: 0
          left-margin: 0
          right-margin: 0
          orientation: vertical
          elements:
            - type: SkinElement
              name: Mail Window Toolbar And Headers
              skin-image: Mail Window Feed Item Headers
              preferred-width: fill
              content:
                type: StackLayout
                orientation: vertical
                elements:
                  - <<: *MailSubjectLabel
                  - type: SkinElement
                    skin-image: Mail Window Feed Item Header Texts
                    preferred-width: fill
                    content:
                      type: StackLayout
                      orientation: horizontal
                      preferred-width: fill
                      elements:
                        - type: Label
                          name: hl_Author
                        - type: Empty
                          preferred-width: fill
                        - *MailDateLabel
                        - *MailFlagButton
            - *MailWindowToolbarGroup
            - *MailWindowBrowser
  - type: SkinElement
    name: Mail Window No Message Selected
    skin-image: Mail Window Background Skin
    content:
      type: SkinElement
      name: Mail Window Background Skin Element
      skin-image: Mail Window No Message Selected Background Overlay
      dynamic-padding: true
      content:
        type: StackLayout
        orientation: vertical
        hcenter: true
        elements:
          - type: Icon
            name: No Message Selected Image
            skin-image: Mail No Message Selected
          - type: Label
            top-margin: 15
            name: No Message Selected Label
            string: S_NO_MESSAGE_SELECTED
            skin-image: Mail No Message Selected Label
            font-rel-size: 150
            font-weight: bold

