Bug 1151206 - Add the titlebar structure to messageWindow, AB and Composer. r=josiah, a=rkent
authorRichard Marti <richard.marti@gmail.com>
Fri, 24 Apr 2015 12:21:40 +0200
changeset 25896 9a99fcc7f1ebe1852f2a5e45733838ccab646231
parent 25895 244c73782efb11c775a5022855170a965469a11f
child 25897 69557a73f991f18cec79b371e54602c52267a192
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosiah, rkent
bugs1151206
Bug 1151206 - Add the titlebar structure to messageWindow, AB and Composer. r=josiah, a=rkent
mail/base/content/messageWindow.xul
mail/components/addrbook/content/addressbook.xul
mail/components/compose/content/messengercompose.xul
mail/themes/osx/mail/addrbook/addressbook.css
mail/themes/osx/mail/compose/messengercompose.css
mail/themes/osx/mail/messageWindow.css
mail/themes/osx/mail/messenger.css
--- a/mail/base/content/messageWindow.xul
+++ b/mail/base/content/messageWindow.xul
@@ -133,16 +133,32 @@
   <menupopup id="attachmentItemContext"/>
   <menupopup id="header-toolbar-context-menu"/>
   <menupopup id="attachment-toolbar-context-menu"/>
   <menupopup id="copyUrlPopup"/>
   <menupopup id="toolbar-context-menu"/>
   <menupopup id="remoteContentOptions"/>
   <menupopup id="phishingOptions"/>
 
+#ifdef XP_MACOSX
+  <vbox id="titlebar">
+    <hbox id="titlebar-content">
+      <spacer id="titlebar-spacer" flex="1"/>
+      <hbox id="titlebar-buttonbox-container" align="start">
+        <hbox id="titlebar-buttonbox">
+          <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
+          <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
+          <toolbarbutton class="titlebar-button" id="titlebar-close" oncommand="window.close()"/>
+        </hbox>
+      </hbox>
+      <hbox id="titlebar-fullscreen-button"/>
+    </hbox>
+  </vbox>
+#endif
+
   <!-- navigation-toolbox is provided by mailWindowOverlay.xul -->
   <toolbox id="navigation-toolbox" class="toolbox-top" />
 
   <!-- mail-toolbox is provided by mailWindowOverlay.xul -->
   <toolbox id="mail-toolbox" />
 
   <tooltip id="aHTMLTooltip" page="true"/>
 
--- a/mail/components/addrbook/content/addressbook.xul
+++ b/mail/components/addrbook/content/addressbook.xul
@@ -220,16 +220,32 @@
            onpopupshowing="onViewToolbarsPopupShowing(event, 'ab-toolbox');">
   <menuseparator id="customizeABToolbarMenuSeparator"/>
   <menuitem id="CustomizeABToolbar"
             command="cmd_CustomizeABToolbar"
             label="&customizeToolbar.label;"
             accesskey="&customizeToolbar.accesskey;"/>
 </menupopup>
 
+#ifdef XP_MACOSX
+<vbox id="titlebar">
+  <hbox id="titlebar-content">
+    <spacer id="titlebar-spacer" flex="1"/>
+    <hbox id="titlebar-buttonbox-container" align="start">
+      <hbox id="titlebar-buttonbox">
+        <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
+        <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
+        <toolbarbutton class="titlebar-button" id="titlebar-close" oncommand="window.close()"/>
+      </hbox>
+    </hbox>
+    <hbox id="titlebar-fullscreen-button"/>
+  </hbox>
+</vbox>
+#endif
+
 <toolbox id="ab-toolbox"
          class="toolbox-top"
          mode="full"
          defaultmode="full"
 #ifdef XP_MACOSX
          iconsize="small"
          defaulticonsize="small"
 #endif
--- a/mail/components/compose/content/messengercompose.xul
+++ b/mail/components/compose/content/messengercompose.xul
@@ -408,16 +408,32 @@
            onpopupshowing="onViewToolbarsPopupShowing(event, 'compose-toolbox');">
   <menuseparator/>
   <menuitem id="CustomizeComposeToolbar"
             command="cmd_CustomizeComposeToolbar"
             label="&customizeToolbar.label;"
             accesskey="&customizeToolbar.accesskey;"/>
 </menupopup>
 
+#ifdef XP_MACOSX
+  <vbox id="titlebar">
+    <hbox id="titlebar-content">
+      <spacer id="titlebar-spacer" flex="1"/>
+      <hbox id="titlebar-buttonbox-container" align="start">
+        <hbox id="titlebar-buttonbox">
+          <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
+          <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
+          <toolbarbutton class="titlebar-button" id="titlebar-close" oncommand="window.close()"/>
+        </hbox>
+      </hbox>
+      <hbox id="titlebar-fullscreen-button"/>
+    </hbox>
+  </vbox>
+#endif
+
   <toolbox id="compose-toolbox"
            class="toolbox-top"
            mode="full"
            defaultmode="full"
 #ifdef XP_MACOSX
            iconsize="small"
            defaulticonsize="small"
 #endif
--- a/mail/themes/osx/mail/addrbook/addressbook.css
+++ b/mail/themes/osx/mail/addrbook/addressbook.css
@@ -16,20 +16,16 @@
   background-repeat: no-repeat;
   background-position: top right;
 }
 
 #ab-bar2 {
   padding: 0 4px;
 }
 
-#ab-bar2:-moz-lwtheme {
-  padding-top: 22px;
-}
-
 /* ::::: primary toolbar buttons ::::: */
 
 .toolbarbutton-1:not([type="menu-button"]),
 .toolbarbutton-1 > .toolbarbutton-menubutton-button,
 .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
   height: 22px;
   padding: 0 4px;
   border: 1px transparent solid;
@@ -632,16 +628,31 @@ spacer {
   cursor: pointer;
 }
 
 #cvHomeMapIt, #cvWorkMapIt {
   margin-bottom: 0px;
   min-height: 19px; /* aqua size for small buttons */
 }
 
+
+#titlebar:not(:-moz-lwtheme),
+#addressbookWindow[sizemode="fullscreen"] > #titlebar {
+  display: none;
+}
+
+#titlebar-buttonbox-container {
+  margin-top: 3px;
+  -moz-margin-start: 7px;
+}
+
+#titlebar-spacer {
+  display: -moz-box;
+}
+
 html|a {
   -moz-padding-start: 0px;
   -moz-padding-end: 2px;
   border: none !important;
   text-decoration: underline;
 }
 
 html|p {
--- a/mail/themes/osx/mail/compose/messengercompose.css
+++ b/mail/themes/osx/mail/compose/messengercompose.css
@@ -10,20 +10,16 @@
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 #msgcomposeWindow:-moz-lwtheme {
   background-repeat: no-repeat;
   background-position: top right;
 }
 
-#composeToolbar2:-moz-lwtheme {
-  padding-top: 22px;
-}
-
 #attachmentBucket {
   width: 15em;
   min-width: 15em;
 }
 
 #compose-toolbox toolbarbutton[checked="true"] {
   background-color: transparent;
 }
@@ -1529,8 +1525,18 @@ toolbarbutton.formatting-button > .toolb
 #searchInput #sidebar {
   -moz-appearance: textfield !important;
   margin: 3px;
 }
 
 #searchInput > .textbox-input-box #sidebar {
   background-image: none !important;
 }
+
+#titlebar:not(:-moz-lwtheme),
+#msgcomposeWindow[sizemode="fullscreen"] > #titlebar {
+  display: none;
+}
+
+#titlebar-buttonbox-container {
+  margin-top: 3px;
+  -moz-margin-start: 7px;
+}
--- a/mail/themes/osx/mail/messageWindow.css
+++ b/mail/themes/osx/mail/messageWindow.css
@@ -13,22 +13,19 @@
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: Mail Toolbars and Menubars ::::: */
 
 .mail-toolbox {
   border-bottom: 0px;
 }
 
-.mail-toolbox:-moz-lwtheme {
-  background: none !important;
-}
-
-#mail-bar3:-moz-lwtheme {
-  padding-top: 22px;
+#mail-toolbox:-moz-lwtheme {
+  background: none;
+  box-shadow: none;
 }
 
 .mail-toolbox > toolbar:not(:-moz-lwtheme) {
   -moz-appearance: toolbar;
 }
 
 /* ::::: message header borders ::::: */
 
--- a/mail/themes/osx/mail/messenger.css
+++ b/mail/themes/osx/mail/messenger.css
@@ -8,16 +8,17 @@
 
 @import url("chrome://global/skin/");
 @import url("chrome://messenger/content/messenger.css");
 @import url("chrome://messenger/skin/shared/messenger.css");
 
 #titlebar {
   -moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
   height: 22px;
+  -moz-window-dragging: drag;
 }
 
 @media (-moz-mac-yosemite-theme) {
   #titlebar:not(:-moz-lwtheme) {
     -moz-appearance: -moz-mac-vibrancy-light !important;
   }
 
   #tabmail {
@@ -175,16 +176,21 @@ notification[value="addon-install-comple
   opacity: 1;
 }
 
 #messengerWindow[tabsintitlebar="true"]:not([sizemode="fullscreen"]):-moz-window-inactive >
   #navigation-toolbox > #tabs-toolbar  > .tabs-alltabs-button {
   opacity: .5;
 }
 
+#messengerWindow:not([tabsintitlebar]) #titlebar-buttonbox-container {
+  margin-top: 3px;
+  -moz-margin-start: 7px;
+}
+
 #messengerWindow[tabsintitlebar="true"] #titlebar-buttonbox-container,
 #messengerWindow[tabsintitlebar="true"] #titlebar-fullscreen-button {
   position: relative;
   margin-top: 11px;
   margin-bottom: 3px;
   padding-bottom: 0px;
 }