Bug 755793 - Allow for drawing in the window titlebar for Australis. r=mconley, ui-r=andreasn

This commit is contained in:
Richard Marti 2012-07-07 09:37:24 -04:00
Родитель cddb88e5f7
Коммит 2a594cbe34
12 изменённых файлов: 379 добавлений и 15 удалений

Просмотреть файл

@ -37,4 +37,4 @@ libs::
ifdef MOZ_MAINTENANCE_SERVICE
$(MAKE) -C installer/windows maintenanceservice_installer
endif
endif
endif

Просмотреть файл

@ -34,6 +34,10 @@ ifdef ENABLE_TESTS
DIRS += test
endif
ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
DEFINES += -DCAN_DRAW_IN_TITLEBAR=1
endif
abs_srcdir = $(call core_abspath,$(srcdir))
CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html

Просмотреть файл

@ -1724,6 +1724,9 @@
<spacer id="menubar_spacer" flex="100%"/>
</menubar>
</toolbaritem>
#ifdef CAN_DRAW_IN_TITLEBAR
<hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
#endif
</toolbar>
</toolbox>

Просмотреть файл

@ -54,7 +54,8 @@
windowtype="mail:3pane"
macanimationtype="document"
lightweightthemes="true"
lightweightthemesfooter="status-bar">
lightweightthemesfooter="status-bar"
chromemargin="0,2,2,2">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
@ -252,6 +253,21 @@
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
<tooltip id="tabmail-tabs-tooltip" onpopupshowing="document.getElementById('tabmail').createTooltip(event);"/>
#ifdef CAN_DRAW_IN_TITLEBAR
<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" command="cmd_quit"/>
</hbox>
</hbox>
</hbox>
</vbox>
#endif
<!-- navigation-toolbox is augmented by mailWindowOverlay.xul -->
<toolbox id="navigation-toolbox" class="toolbox-top">
@ -292,6 +308,9 @@
id="alltabs-popup" position="after_end"
tabcontainer="tabcontainer"/>
</toolbarbutton>
#ifdef CAN_DRAW_IN_TITLEBAR
<hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
#endif
</toolbar>
</toolbox>

Просмотреть файл

@ -330,12 +330,12 @@ function AutoConfigWizard(okCallback)
function OnLoadMessenger()
{
migrateMailnews();
// Rig up our TabsInTitlebar early so that we can catch any resize events.
TabsInTitlebar.init();
// update the pane config before we exit onload otherwise the user may see a flicker if we poke the document
// in delayedOnLoadMessenger...
UpdateMailPaneConfig(false);
document.loadBindingDocument('chrome://global/content/bindings/textbox.xml');
// Set a sane starting width/height for all resolutions on new profiles.
// Do this before the window loads.
if (!document.documentElement.hasAttribute("width"))
@ -601,6 +601,8 @@ function OnUnloadMessenger()
sessionStoreManager.unloadingWindow(window);
TabsInTitlebar.uninit();
let tabmail = document.getElementById("tabmail");
tabmail._teardown();
@ -1589,3 +1591,79 @@ function InitPageMenu(menuPopup, event) {
if (menuPopup.children.length == 0)
event.preventDefault();
}
let TabsInTitlebar = {
init: function () {
#ifdef CAN_DRAW_IN_TITLEBAR
// Don't trust the initial value of the sizemode attribute; wait for the resize event.
this.allowedBy("sizemode", false);
window.addEventListener("resize", function (event) {
if (event.target != window)
return;
TabsInTitlebar.allowedBy("sizemode", true);
}, false);
this._initialized = true;
#endif
},
allowedBy: function (condition, allow) {
#ifdef CAN_DRAW_IN_TITLEBAR
if (allow) {
if (condition in this._disallowed) {
delete this._disallowed[condition];
this._update();
}
} else {
if (!(condition in this._disallowed)) {
this._disallowed[condition] = null;
this._update();
}
}
#endif
},
_initialized: false,
_disallowed: {},
_update: function () {
#ifdef CAN_DRAW_IN_TITLEBAR
if (!this._initialized || window.fullScreen)
return;
function $(id) document.getElementById(id);
let titlebar = $("titlebar");
function rect(ele) ele.getBoundingClientRect();
let titlebar = $("titlebar");
let captionButtonsBox = $("titlebar-buttonbox");
this._sizePlaceholder("caption-buttons", rect(captionButtonsBox).width);
let titlebarRect = rect(titlebar);
titlebar.style.marginBottom = - (titlebarRect.height - 16) + "px";
#endif
},
#ifdef CAN_DRAW_IN_TITLEBAR
_sizePlaceholder: function (type, width) {
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='"+ type +"']"),
function (node) { node.width = width; });
},
#endif
uninit: function () {
#ifdef CAN_DRAW_IN_TITLEBAR
this._initialized = false;
#endif
}
};
/* Draw */
function onTitlebarMaxClick() {
if (window.windowState == window.STATE_MAXIMIZED)
window.restore();
else
window.maximize();
}

Просмотреть файл

@ -32,7 +32,7 @@ messenger.jar:
content/messenger/mailWidgets.xml (content/mailWidgets.xml)
content/messenger/editContactOverlay.js (content/editContactOverlay.js)
* content/messenger/editContactOverlay.xul (content/editContactOverlay.xul)
content/messenger/msgMail3PaneWindow.js (content/msgMail3PaneWindow.js)
* content/messenger/msgMail3PaneWindow.js (content/msgMail3PaneWindow.js)
content/messenger/mail3PaneWindowCommands.js (content/mail3PaneWindowCommands.js)
content/messenger/mailCommands.js (content/mailCommands.js)
* content/messenger/mailCore.js (content/mailCore.js)

Двоичные данные
mail/themes/qute/mail/icons/closeTab.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.0 KiB

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

@ -4,6 +4,65 @@
%include mailWindow1.css
@media (-moz-windows-default-theme) {
#messengerWindow[sizemode="maximized"] > #navigation-toolbox{
margin-top: -6px;
}
}
@media (-moz-windows-compositor) {
#messengerWindow[sizemode="normal"] > #titlebar > #titlebar-content {
border-top-width: 0;
}
#messengerWindow[sizemode="normal"] #titlebar-buttonbox {
margin-top: 0;
}
#messengerWindow[sizemode="normal"] > #titlebar > #titlebar-content:-moz-lwtheme {
margin-bottom: -2px;
border-top: 2px solid;
-moz-border-top-colors: rgb(37, 44, 51) rgba(255, 255, 255, .6);
}
.titlebar-button {
display: none;
}
#main-window[sizemode="maximized"] #titlebar-buttonbox {
-moz-margin-end: 3px;
}
#titlebar-buttonbox-container:-moz-lwtheme {
-moz-appearance: -moz-window-button-box;
}
#messengerWindow:not(:-moz-lwtheme) {
-moz-appearance: -moz-win-borderless-glass;
background-color: transparent;
}
}
@media not all and (-moz-windows-compositor) {
@media (-moz-windows-default-theme) {
#messengerWindow:not(:-moz-lwtheme) {
background-color: rgb(185, 209, 234);
}
#messengerWindow:not(:-moz-lwtheme):-moz-window-inactive {
background-color: rgb(215, 228, 242);
}
#messengerWindow[sizemode="normal"] > #titlebar > #titlebar-content {
border-top-width: 2px;
-moz-border-top-colors: #4D4D4D #E9ECF3;
}
#messengerWindow[sizemode="normal"] #titlebar-buttonbox {
margin-top: -2px;
}
}
}
#subjectCol {
-moz-padding-start: 20px;
}

Просмотреть файл

@ -384,3 +384,140 @@ treechildren::-moz-tree-cell-text(subjectCol) {
#tabpanelcontainer {
-moz-appearance: none;
}
/* ..... Draw in titlebar ..... */
@media (-moz-windows-default-theme) {
#messengerWindow {
background-color: ActiveCaption;
}
#messengerWindow:-moz-window-inactive {
background-color: InactiveCaption;
}
}
/* Luna silver needs special colors. Default doesn't look good */
@media (-moz-windows-theme: luna-silver) {
#messengerWindow {
background-color: #D6D8E1;
}
#messengerWindow:-moz-window-inactive {
background-color: #E8E9F1;
}
}
#messengerWindow:-moz-lwtheme {
background-color: transparent;
}
#titlebar {
-moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
}
#titlebar:-moz-lwtheme {
visibility: hidden;
}
#titlebar-content:-moz-lwtheme {
-moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
visibility: visible;
}
#titlebar-spacer {
pointer-events: none;
}
#tabs-toolbar {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
}
#titlebar-buttonbox {
-moz-appearance: -moz-window-button-box;
position: relative;
}
#titlebar-min {
-moz-appearance: -moz-window-button-minimize;
}
@media not all and (-moz-windows-classic) {
#titlebar-min {
-moz-margin-end: 2px;
}
}
#titlebar-max {
-moz-appearance: -moz-window-button-maximize;
}
#messengerWindow[sizemode="maximized"] #titlebar-max {
-moz-appearance: -moz-window-button-restore;
}
#titlebar-close {
-moz-appearance: -moz-window-button-close;
}
.titlebar-placeholder[type="caption-buttons"] {
margin-left: 10px; /* additional space for Aero Snap */
}
/* Window titlebar drawn by TB. So needs border like system windows */
#messengerWindow[sizemode="normal"] > #titlebar > #titlebar-content {
border-top: 3px solid;
-moz-border-top-colors: ThreeDLightShadow ThreeDHighlight ActiveBorder;
}
#messengerWindow[sizemode="normal"] #titlebar-buttonbox {
margin-top: -3px;
}
#messengerWindow[sizemode="normal"] > #titlebar >
#titlebar-content:-moz-window-inactive {
-moz-border-top-colors: ThreeDLightShadow ThreeDHighlight InactiveBorder;
}
@media (-moz-windows-default-theme) {
#messengerWindow[sizemode="normal"] > #titlebar > #titlebar-content {
-moz-border-top-colors: rgba(0, 0, 0, .1) rgba(255, 255, 255, .3)
rgba(255, 255, 255, .2);
}
#messengerWindow[sizemode="normal"] > #titlebar >
#titlebar-content:-moz-window-inactive {
-moz-border-top-colors: rgba(255, 255, 255, .4) rgba(255, 255, 255, .3)
rgba(255, 255, 255, .2);
}
}
@media (-moz-windows-theme: luna-silver) {
#messengerWindow[sizemode="normal"] > #titlebar > #titlebar-content {
-moz-border-top-colors: rgba(0, 0, 0, .4) rgba(255, 255, 255, .3)
rgba(255, 255, 255, .2);
}
}
/* Black on dark background doesn't look good */
@media (-moz-windows-theme: luna-blue) {
menubar:not(:-moz-lwtheme) > menu {
color: white;
}
}
@media (-moz-windows-theme: royale) {
menubar:not(:-moz-lwtheme) > menu {
color: white;
}
}
@media (-moz-windows-theme: zune) {
menubar:not(:-moz-lwtheme) > menu {
color: white;
}
}
#messengerWindow[sizemode="maximized"] > #navigation-toolbox{
margin-top: -12px;
}

Просмотреть файл

@ -23,6 +23,10 @@
background-color: -moz-Dialog;
}
#navigation-toolbox {
background-color: transparent !important;
}
.mail-toolbox {
-moz-box-pack: center;
min-height: 41px;
@ -49,7 +53,7 @@
}
#navigation-toolbox #tabs-toolbar:not(:-moz-lwtheme) {
border-bottom: 1px solid ThreeDShadow;
border-bottom: 1px solid rgba(10, 31, 51, .35);
}
#navigation-toolbox #tabs-toolbar:-moz-lwtheme {
@ -68,7 +72,6 @@
@media (-moz-windows-default-theme) {
.mail-toolbox:not(:-moz-lwtheme),
#navigation-toolbox:not(:-moz-lwtheme),
.contentTabToolbox:not(:-moz-lwtheme) {
background-color: hsl(210, 75%, 92%);
}
@ -80,11 +83,6 @@
rgba(255, 255, 255, 0));
}
#navigation-toolbox:not(:-moz-lwtheme) {
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0),
rgba(255, 255, 255, .5));
}
.chromeclass-toolbar {
/* Toolbar buttons have a margin of 3px; adjust the toolbar so the leftmost
button lines up with the rest of the window. */

Просмотреть файл

@ -13,12 +13,18 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#navigation-toolbox #tabs-toolbar {
#navigation-toolbox {
-moz-appearance: none;
border-bottom: 1px solid ThreeDShadow;
border-top-width: 0;
background-color: transparent;
}
#navigation-toolbox #tabs-toolbar:-moz-lwtheme {
#tabs-toolbar {
-moz-appearance: none;
border-bottom: 1px solid rgba(10, 31, 51, .35);
}
#tabs-toolbar:-moz-lwtheme {
border-bottom-color: transparent;
}

Просмотреть файл

@ -38,6 +38,24 @@
text-shadow: none;
}
@media (-moz-windows-theme: luna-blue) {
.tabmail-tab:not([selected]):not(:-moz-lwtheme) {
color: white;
}
}
@media (-moz-windows-theme: royale) {
.tabmail-tab:not([selected]):not(:-moz-lwtheme) {
color: white;
}
}
@media (-moz-windows-theme: zune) {
.tabmail-tab:not([selected]):not(:-moz-lwtheme) {
color: white;
}
}
.tabmail-tab:-moz-lwtheme {
color: inherit;
text-shadow: inherit;
@ -226,6 +244,30 @@ tabpanels {
list-style-image: url(icons/closeTab.png);
}
@media (-moz-windows-theme: luna-blue) {
.tabmail-tab:not([selected]) > .tab-stack > .tab-content >
.tab-close-button:not(:hover):not(:active),
.tabs-closebutton {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
}
@media (-moz-windows-theme: royale) {
.tabmail-tab:not([selected]) > .tab-stack > .tab-content >
.tab-close-button:not(:hover):not(:active),
.tabs-closebutton {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
}
@media (-moz-windows-theme: zune) {
.tabmail-tab:not([selected]) > .tab-stack > .tab-content >
.tab-close-button:not(:hover):not(:active),
.tabs-closebutton {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
}
.tabs-closebutton {
padding: 0 2px;
}
@ -349,6 +391,24 @@ tabpanels {
list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
}
@media (-moz-windows-theme: luna-blue) {
.tabs-alltabs-button:not(:hover) > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme) {
list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
}
}
@media (-moz-windows-theme: royale) {
.tabs-alltabs-button:not(:-moz-lwtheme) > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme) {
list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
}
}
@media (-moz-windows-theme: zune) {
.tabs-alltabs-button:not(:-moz-lwtheme) > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme) {
list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
}
}
/**
* All Tabs Menupopup
*/