Mike Conley 2013-04-19 16:58:03 -04:00
Родитель 442373cbdb b8cfbb428e
Коммит c519c6a5f8
83 изменённых файлов: 4555 добавлений и 865 удалений

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

@ -0,0 +1,102 @@
# -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# 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/.
/**
* Customization handler prepares this browser window for entering and exiting
* customization mode by handling CustomizationStart and CustomizationEnd
* events.
*/
let CustomizationHandler = {
handleEvent: function(aEvent) {
switch(aEvent.type) {
case "CustomizationStart":
this._customizationStart();
break;
case "CustomizationEnd":
this._customizationEnd(aEvent.detail);
break;
}
},
_customizationStart: function() {
// Disable the toolbar context menu items
let menubar = document.getElementById("main-menubar");
for (let childNode of menubar.childNodes)
childNode.setAttribute("disabled", true);
let cmd = document.getElementById("cmd_CustomizeToolbars");
cmd.setAttribute("disabled", "true");
let splitter = document.getElementById("urlbar-search-splitter");
if (splitter) {
splitter.parentNode.removeChild(splitter);
}
CombinedStopReload.uninit();
PlacesToolbarHelper.customizeStart();
BookmarksMenuButton.customizeStart();
DownloadsButton.customizeStart();
TabsInTitlebar.allowedBy("customizing-toolbars", false);
},
_customizationEnd: function(aDetails) {
// Update global UI elements that may have been added or removed
if (aDetails.changed) {
gURLBar = document.getElementById("urlbar");
gProxyFavIcon = document.getElementById("page-proxy-favicon");
gHomeButton.updateTooltip();
gIdentityHandler._cacheElements();
XULBrowserWindow.init();
#ifndef XP_MACOSX
updateEditUIVisibility();
#endif
// Hacky: update the PopupNotifications' object's reference to the iconBox,
// if it already exists, since it may have changed if the URL bar was
// added/removed.
if (!window.__lookupGetter__("PopupNotifications")) {
PopupNotifications.iconBox =
document.getElementById("notification-popup-box");
}
}
PlacesToolbarHelper.customizeDone();
BookmarksMenuButton.customizeDone();
DownloadsButton.customizeDone();
// The url bar splitter state is dependent on whether stop/reload
// and the location bar are combined, so we need this ordering
CombinedStopReload.init();
UpdateUrlbarSearchSplitterState();
setUrlAndSearchBarWidthForConditionalForwardButton();
// Update the urlbar
if (gURLBar) {
URLBarSetURI();
XULBrowserWindow.asyncUpdateUI();
PlacesStarButton.updateState();
SocialShareButton.updateShareState();
}
TabsInTitlebar.allowedBy("customizing-toolbars", true);
// Re-enable parts of the UI we disabled during the dialog
let menubar = document.getElementById("main-menubar");
for (let childNode of menubar.childNodes)
childNode.setAttribute("disabled", false);
let cmd = document.getElementById("cmd_CustomizeToolbars");
cmd.removeAttribute("disabled");
// make sure to re-enable click-and-hold
if (!getBoolPref("ui.click_hold_context_menus", false)) {
SetClickAndHoldHandlers();
}
gBrowser.selectedBrowser.focus();
}
}

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

@ -9,6 +9,10 @@ searchbar {
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
}
#nav-bar {
-moz-binding: url("chrome://browser/content/toolbar.xml#toolbar");
}
tabbrowser {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser");
}

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

@ -90,6 +90,12 @@ XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
XPCOMUtils.defineLazyModuleGetter(this, "AboutHomeUtils",
"resource:///modules/AboutHomeUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", function() {
let scope = {};
Cu.import("resource:///modules/CustomizeMode.jsm", scope);
return new scope.CustomizeMode(window);
});
#ifdef MOZ_SERVICES_SYNC
XPCOMUtils.defineLazyModuleGetter(this, "Weave",
"resource://services-sync/main.js");
@ -146,6 +152,7 @@ let gInitialPages = [
];
#include browser-addons.js
#include browser-customization.js
#include browser-feeds.js
#include browser-fullScreen.js
#include browser-fullZoom.js
@ -1031,6 +1038,7 @@ var gBrowserInit = {
OfflineApps.init();
IndexedDBPromptHelper.init();
gFormSubmitObserver.init();
PanelUI.init();
SocialUI.init();
AddonManager.addAddonListener(AddonsMgrListener);
WebrtcIndicator.init();
@ -1268,6 +1276,11 @@ var gBrowserInit = {
window.addEventListener("mousemove", MousePosTracker, false);
window.addEventListener("dragover", MousePosTracker, false);
window.addEventListener("CustomizationStart", CustomizationHandler, false);
window.addEventListener("CustomizationEnd", CustomizationHandler, false);
gCustomizeMode.init();
// End startup crash tracking after a delay to catch crashes while restoring
// tabs and to postpone saving the pref to disk.
try {
@ -1363,6 +1376,8 @@ var gBrowserInit = {
IndexedDBPromptHelper.uninit();
AddonManager.removeAddonListener(AddonsMgrListener);
SocialUI.uninit();
gCustomizeMode.uninit();
PanelUI.uninit();
}
// Final window teardown, do this last.
@ -3309,118 +3324,13 @@ function OpenBrowserWindow(options)
return win;
}
var gCustomizeSheet = false;
//XXXunf Are these still useful to keep around?
function BrowserCustomizeToolbar() {
// Disable the toolbar context menu items
var menubar = document.getElementById("main-menubar");
for (let childNode of menubar.childNodes)
childNode.setAttribute("disabled", true);
var cmd = document.getElementById("cmd_CustomizeToolbars");
cmd.setAttribute("disabled", "true");
var splitter = document.getElementById("urlbar-search-splitter");
if (splitter)
splitter.parentNode.removeChild(splitter);
CombinedStopReload.uninit();
PlacesToolbarHelper.customizeStart();
BookmarksMenuButton.customizeStart();
DownloadsButton.customizeStart();
TabsInTitlebar.allowedBy("customizing-toolbars", false);
var customizeURL = "chrome://global/content/customizeToolbar.xul";
gCustomizeSheet = getBoolPref("toolbar.customization.usesheet", false);
if (gCustomizeSheet) {
let sheetFrame = document.createElement("iframe");
let panel = document.getElementById("customizeToolbarSheetPopup");
sheetFrame.id = "customizeToolbarSheetIFrame";
sheetFrame.toolbox = gNavToolbox;
sheetFrame.panel = panel;
sheetFrame.setAttribute("style", panel.getAttribute("sheetstyle"));
panel.appendChild(sheetFrame);
// Open the panel, but make it invisible until the iframe has loaded so
// that the user doesn't see a white flash.
panel.style.visibility = "hidden";
gNavToolbox.addEventListener("beforecustomization", function onBeforeCustomization() {
gNavToolbox.removeEventListener("beforecustomization", onBeforeCustomization, false);
panel.style.removeProperty("visibility");
}, false);
sheetFrame.setAttribute("src", customizeURL);
panel.openPopup(gNavToolbox, "after_start", 0, 0);
} else {
window.openDialog(customizeURL,
"CustomizeToolbar",
"chrome,titlebar,toolbar,location,resizable,dependent",
gNavToolbox);
}
gCustomizeMode.enter();
}
function BrowserToolboxCustomizeDone(aToolboxChanged) {
if (gCustomizeSheet) {
document.getElementById("customizeToolbarSheetPopup").hidePopup();
let iframe = document.getElementById("customizeToolbarSheetIFrame");
iframe.parentNode.removeChild(iframe);
}
// Update global UI elements that may have been added or removed
if (aToolboxChanged) {
gURLBar = document.getElementById("urlbar");
gProxyFavIcon = document.getElementById("page-proxy-favicon");
gHomeButton.updateTooltip();
gIdentityHandler._cacheElements();
window.XULBrowserWindow.init();
#ifndef XP_MACOSX
updateEditUIVisibility();
#endif
// Hacky: update the PopupNotifications' object's reference to the iconBox,
// if it already exists, since it may have changed if the URL bar was
// added/removed.
if (!window.__lookupGetter__("PopupNotifications"))
PopupNotifications.iconBox = document.getElementById("notification-popup-box");
}
PlacesToolbarHelper.customizeDone();
BookmarksMenuButton.customizeDone();
DownloadsButton.customizeDone();
// The url bar splitter state is dependent on whether stop/reload
// and the location bar are combined, so we need this ordering
CombinedStopReload.init();
UpdateUrlbarSearchSplitterState();
setUrlAndSearchBarWidthForConditionalForwardButton();
// Update the urlbar
if (gURLBar) {
URLBarSetURI();
XULBrowserWindow.asyncUpdateUI();
PlacesStarButton.updateState();
SocialShareButton.updateShareState();
}
TabsInTitlebar.allowedBy("customizing-toolbars", true);
// Re-enable parts of the UI we disabled during the dialog
var menubar = document.getElementById("main-menubar");
for (let childNode of menubar.childNodes)
childNode.setAttribute("disabled", false);
var cmd = document.getElementById("cmd_CustomizeToolbars");
cmd.removeAttribute("disabled");
// make sure to re-enable click-and-hold
if (!getBoolPref("ui.click_hold_context_menus", false))
SetClickAndHoldHandlers();
gBrowser.selectedBrowser.focus();
gCustomizeMode.exit(aToolboxChanged);
}
function BrowserToolboxCustomizeChange(aType) {
@ -3591,6 +3501,8 @@ var XULBrowserWindow = {
startTime: 0,
statusText: "",
isBusy: false,
// The pages in this array should be kept in sync with what pages that
// panelUIOverlay.xul is set to overlay in /browser/base/jar.mn
inContentWhitelist: ["about:addons", "about:downloads", "about:permissions",
"about:sync-progress", "about:preferences"],
@ -4560,10 +4472,19 @@ var TabsInTitlebar = {
this._readPref();
Services.prefs.addObserver(this._prefName, this, false);
// Don't trust the initial value of the sizemode attribute; wait for
// the resize event (handled in tabbrowser.xml).
this.allowedBy("sizemode", false);
// We need to update the appearance of the titlebar when the menu changes
// from the active to the inactive state. We can't, however, rely on
// DOMMenuBarInactive, because the menu fires this event and then removes
// the inactive attribute after an event-loop spin.
//
// Because updating the appearance involves sampling the heights and margins
// of various elements, it's important that the layout be more or less
// settled before updating the titlebar. So instead of listening to
// DOMMenuBarActive and DOMMenuBarInactive, we use a MutationObserver to
// watch the "invalid" attribute directly.
let menu = document.getElementById("toolbar-menubar");
this._menuObserver = new MutationObserver(this._onMenuMutate);
this._menuObserver.observe(menu, {attributes: true});
this._initialized = true;
#endif
},
@ -4573,17 +4494,23 @@ var TabsInTitlebar = {
if (allow) {
if (condition in this._disallowed) {
delete this._disallowed[condition];
this._update();
this._update(true);
}
} else {
if (!(condition in this._disallowed)) {
this._disallowed[condition] = null;
this._update();
this._update(true);
}
}
#endif
},
updateAppearance: function updateAppearance(aForce) {
#ifdef CAN_DRAW_IN_TITLEBAR
this._update(aForce);
#endif
},
get enabled() {
return document.documentElement.getAttribute("tabsintitlebar") == "true";
},
@ -4594,35 +4521,73 @@ var TabsInTitlebar = {
this._readPref();
},
_onMenuMutate: function (aMutations) {
// We don't care about restored windows, since the menu shouldn't be
// pushing the tab-strip down.
if (document.documentElement.getAttribute("sizemode") == "normal") {
return;
}
for (let mutation of aMutations) {
if (mutation.attributeName == "inactive" ||
mutation.attributeName == "autohide") {
TabsInTitlebar._update(true);
return;
}
}
},
_initialized: false,
_disallowed: {},
_prefName: "browser.tabs.drawInTitlebar",
_lastSizeMode: null,
_readPref: function () {
this.allowedBy("pref",
Services.prefs.getBoolPref(this._prefName));
},
_update: function () {
_update: function (aForce=false) {
if (!this._initialized || window.fullScreen)
return;
let allowed = true;
if (!aForce) {
// _update is called on resize events, because the window is not ready
// after sizemode events. However, we only care about the event when the
// sizemode is different from the last time we updated the appearance of
// the tabs in the titlebar.
let sizemode = document.documentElement.getAttribute("sizemode");
if (this._lastSizeMode == sizemode) {
return;
}
this._lastSizeMode = sizemode;
}
for (let something in this._disallowed) {
allowed = false;
break;
}
if (allowed == this.enabled)
return;
function $(id) document.getElementById(id);
let titlebar = $("titlebar");
let titlebarContent = $("titlebar-content");
let menubar = $("toolbar-menubar");
// Reset the margins that _update modifies so that we can take accurate
// measurements.
titlebarContent.style.marginBottom = "";
titlebar.style.marginBottom = "";
menubar.style.marginBottom = "";
if (allowed) {
function rect(ele) ele.getBoundingClientRect();
// We set the tabsintitlebar attribute first so that our CSS for
// tabsintitlebar manifests before we do our measurements.
document.documentElement.setAttribute("tabsintitlebar", "true");
let tabsToolbar = $("TabsToolbar");
function rect(ele) ele.getBoundingClientRect();
#ifdef MENUBAR_CAN_AUTOHIDE
let appmenuButtonBox = $("appmenu-button-container");
@ -4631,25 +4596,58 @@ var TabsInTitlebar = {
let captionButtonsBox = $("titlebar-buttonbox");
this._sizePlaceholder("caption-buttons", rect(captionButtonsBox).width);
let tabsToolbarRect = rect(tabsToolbar);
let titlebarTop = rect($("titlebar-content")).top;
titlebar.style.marginBottom = - Math.min(tabsToolbarRect.top - titlebarTop,
tabsToolbarRect.height) + "px";
let titlebarContentHeight = rect(titlebarContent).height;
let menuHeight = this._outerHeight(menubar);
document.documentElement.setAttribute("tabsintitlebar", "true");
// If the titlebar is taller than the menubar, add more padding to the
// bottom of the menubar so that it matches.
if (menuHeight && titlebarContentHeight > menuHeight) {
let menuTitlebarDelta = titlebarContentHeight - menuHeight;
menubar.style.marginBottom = menuTitlebarDelta + "px";
menuHeight += menuTitlebarDelta;
}
if (!this._draghandle) {
// Next, we calculate how much we need to stretch the titlebar down to
// go all the way to the bottom of the tab strip.
let tabsToolbar = $("TabsToolbar");
let tabAndMenuHeight = this._outerHeight(tabsToolbar) + menuHeight;
titlebarContent.style.marginBottom = tabAndMenuHeight + "px";
// Finally, we have to determine how much to bring up the elements below
// the titlebar. We start with a baseHeight of tabAndMenuHeight, to offset
// the amount we added to the titlebar content. Then, we have two cases:
//
// 1) The titlebar is larger than the tabAndMenuHeight. This can happen in
// large font mode with the menu autohidden. In this case, we want to
// add tabAndMenuHeight, since this should line up the bottom of the
// tabstrip with the bottom of the titlebar.
//
// 2) The titlebar is equal to or smaller than the tabAndMenuHeight. This
// is the more common case, and occurs with normal font sizes. In this
// case, we want to bring the menu and tabstrip right up to the top of
// the titlebar, so we add the titlebarContentHeight to the baseHeight.
let baseHeight = tabAndMenuHeight;
baseHeight += (titlebarContentHeight > tabAndMenuHeight) ? tabAndMenuHeight
: titlebarContentHeight;
titlebar.style.marginBottom = "-" + baseHeight + "px";
if (!this._draghandles) {
this._draghandles = {};
let tmp = {};
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
this._draghandle = new tmp.WindowDraggingElement(tabsToolbar);
this._draghandle.mouseDownCheck = function () {
let mouseDownCheck = function () {
return !this._dragBindingAlive && TabsInTitlebar.enabled;
};
this._draghandles.tabsToolbar = new tmp.WindowDraggingElement(tabsToolbar);
this._draghandles.tabsToolbar.mouseDownCheck = mouseDownCheck;
this._draghandles.navToolbox = new tmp.WindowDraggingElement(gNavToolbox);
this._draghandles.navToolbox.mouseDownCheck = mouseDownCheck;
}
} else {
document.documentElement.removeAttribute("tabsintitlebar");
titlebar.style.marginBottom = "";
}
},
@ -4657,12 +4655,30 @@ var TabsInTitlebar = {
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='"+ type +"']"),
function (node) { node.width = width; });
},
/**
* Retrieve the height of an element, including its top and bottom
* margins.
*
* @param ele
* The element to measure.
* @return
* The height and margins as an integer. If the height of the element
* is 0, then this returns 0, regardless of what the margins are.
*/
_outerHeight: function (ele) {
let cstyle = document.defaultView.getComputedStyle(ele);
let margins = parseInt(cstyle.marginTop) + parseInt(cstyle.marginBottom);
let height = ele.getBoundingClientRect().height;
return height > 0 ? Math.abs(height + margins) : 0;
},
#endif
uninit: function () {
#ifdef CAN_DRAW_IN_TITLEBAR
this._initialized = false;
Services.prefs.removeObserver(this._prefName, this);
this._menuObserver.disconnect();
#endif
}
};
@ -4675,14 +4691,14 @@ function updateAppButtonDisplay() {
document.getElementById("toolbar-menubar").getAttribute("autohide") == "true";
#ifdef CAN_DRAW_IN_TITLEBAR
document.getElementById("titlebar").hidden = !displayAppButton;
document.getElementById("titlebar").hidden = gInPrintPreviewMode;
if (displayAppButton)
if (!gInPrintPreviewMode)
document.documentElement.setAttribute("chromemargin", "0,2,2,2");
else
document.documentElement.removeAttribute("chromemargin");
TabsInTitlebar.allowedBy("drawing-in-titlebar", displayAppButton);
TabsInTitlebar.allowedBy("drawing-in-titlebar", !gInPrintPreviewMode);
#else
document.getElementById("appmenu-toolbar-button").hidden =
!displayAppButton;
@ -6721,12 +6737,6 @@ let gPrivateBrowsingUI = {
document.getElementById("Tools:Sanitize").setAttribute("disabled", "true");
if (window.location.href == getBrowserURL()) {
#ifdef XP_MACOSX
if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
document.documentElement.setAttribute("drawintitlebar", true);
}
#endif
// Adjust the window's title
let docElement = document.documentElement;
if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {

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

@ -9,6 +9,7 @@
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/panelUIOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
@ -22,6 +23,7 @@
<window id="main-window"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="gBrowserInit.onLoad()" onunload="gBrowserInit.onUnload()" onclose="return WindowIsClosing();"
title="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
@ -32,6 +34,7 @@
titlemodifier=""
titlemodifier_normal=""
titlemodifier_privatebrowsing="&mainWindow.titlePrivateBrowsingSuffix;"
chromemargin="0,-1,-1,-1"
#else
title_privatebrowsing="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@ &mainWindow.titlePrivateBrowsingSuffix;"
titlemodifier="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@"
@ -464,6 +467,7 @@
</popupnotificationcontent>
</popupnotification>
#include panelUI.inc
</popupset>
#ifdef CAN_DRAW_IN_TITLEBAR
@ -524,6 +528,7 @@
fullscreentoolbar="true" mode="icons" customizable="true"
iconsize="large"
defaultset="unified-back-forward-button,urlbar-container,reload-button,stop-button,search-container,webrtc-status-button,downloads-button,home-button,bookmarks-menu-button-container,window-controls"
customizationtarget="nav-bar-customizationtarget"
context="toolbar-context-menu">
<toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"
@ -655,11 +660,7 @@
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>
<toolbaritem id="search-container" title="&searchItem.title;"
align="center" class="chromeclass-toolbar-additional"
flex="100" persist="width" removable="true">
<searchbar id="searchbar" flex="1"/>
</toolbaritem>
<hbox id="nav-bar-customizationtarget" class="customization-target" flex="100"/>
<toolbarbutton id="webrtc-status-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
@ -673,147 +674,15 @@
oncommand="WebrtcIndicator.menuCommand(event.target);"/>
</toolbarbutton>
<toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
persist="class" removable="true"
label="&homeButton.label;"
ondragover="homeButtonObserver.onDragOver(event)"
ondragenter="homeButtonObserver.onDragOver(event)"
ondrop="homeButtonObserver.onDrop(event)"
ondragexit="homeButtonObserver.onDragExit(event)"
onclick="BrowserGoHome(event);"
aboutHomeOverrideTooltip="&abouthome.pageTitle;"/>
<toolbaritem id="social-toolbar-item"
<toolbaritem id="PanelUI-button"
class="chromeclass-toolbar-additional"
removable="false"
title="&socialToolbar.title;"
hidden="true"
skipintoolbarset="true"
observes="socialActiveBroadcaster">
<toolbarbutton id="social-provider-button"
title="&appmenu.title;">
<toolbarbutton id="PanelUI-menu-button"
class="toolbarbutton-1"
type="menu">
<menupopup id="social-statusarea-popup">
<menuitem class="social-statusarea-user menuitem-iconic" pack="start" align="center"
observes="socialBroadcaster_userDetails"
oncommand="SocialUI.showProfile(); document.getElementById('social-statusarea-popup').hidePopup();">
<image class="social-statusarea-user-portrait"
observes="socialBroadcaster_userDetails"/>
<vbox>
<label class="social-statusarea-loggedInStatus"
observes="socialBroadcaster_userDetails"/>
</vbox>
</menuitem>
#ifndef XP_WIN
<menuseparator class="social-statusarea-separator"/>
#endif
<menuitem class="social-toggle-sidebar-menuitem"
type="checkbox"
autocheck="false"
command="Social:ToggleSidebar"
label="&social.toggleSidebar.label;"
accesskey="&social.toggleSidebar.accesskey;"/>
<menuitem class="social-toggle-notifications-menuitem"
type="checkbox"
autocheck="false"
command="Social:ToggleNotifications"
label="&social.toggleNotifications.label;"
accesskey="&social.toggleNotifications.accesskey;"/>
<menuitem class="social-toggle-menuitem" command="Social:Toggle"/>
<menuseparator class="social-statusarea-separator"/>
<menuseparator class="social-provider-menu" hidden="true"/>
<menuitem class="social-addons-menuitem" command="Social:Addons"
label="&social.addons.label;"/>
<menuitem label="&social.learnMore.label;"
accesskey="&social.learnMore.accesskey;"
oncommand="SocialUI.showLearnMore();"/>
</menupopup>
</toolbarbutton>
</toolbaritem>
<toolbaritem id="bookmarks-menu-button-container"
class="chromeclass-toolbar-additional"
removable="true"
title="&bookmarksMenuButton.label;">
<toolbarbutton id="bookmarks-menu-button"
type="menu"
class="toolbarbutton-1"
label="&bookmarksMenuButton.label;"
tooltiptext="&bookmarksMenuButton.tooltip;"
ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
ondragover="PlacesMenuDNDHandler.onDragOver(event);"
ondragexit="PlacesMenuDNDHandler.onDragExit(event);"
ondrop="PlacesMenuDNDHandler.onDrop(event);">
<menupopup id="BMB_bookmarksPopup"
placespopup="true"
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
tooltip="bhTooltip" popupsinherittooltip="true">
<menuitem id="BMB_viewBookmarksToolbar"
placesanonid="view-toolbar"
toolbarId="PersonalToolbar"
type="checkbox"
oncommand="onViewToolbarCommand(event)"
label="&viewBookmarksToolbar.label;"/>
<menuseparator/>
<menuitem id="BMB_bookmarksShowAll"
label="&showAllBookmarks2.label;"
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator/>
<menuitem id="BMB_bookmarkThisPage"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&bookmarkThisPageCmd.label;"
command="Browser:AddBookmarkAs"
key="addBookmarkAsKb"/>
<menuitem id="BMB_subscribeToPageMenuitem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&subscribeToPageMenuitem.label;"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"
observes="singleFeedMenuitemState"/>
<menu id="BMB_subscribeToPageMenupopup"
#ifndef XP_MACOSX
class="menu-iconic"
#endif
label="&subscribeToPageMenupopup.label;"
observes="multipleFeedsMenuState">
<menupopup id="BMB_subscribeToPageSubmenuMenupopup"
onpopupshowing="return FeedHandler.buildFeedList(event.target);"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"/>
</menu>
<menuseparator/>
<menu id="BMB_bookmarksToolbar"
placesanonid="toolbar-autohide"
class="menu-iconic bookmark-item"
label="&personalbarCmd.label;"
container="true">
<menupopup id="BMB_bookmarksToolbarPopup"
placespopup="true"
context="placesContext"
onpopupshowing="if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
</menu>
<menuseparator/>
<!-- Bookmarks menu items -->
<menuseparator builder="end"
class="hide-if-empty-places-result"/>
<menuitem id="BMB_unsortedBookmarks"
label="&bookmarksMenuButton.unsorted.label;"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"
class="menuitem-iconic"/>
</menupopup>
</toolbarbutton>
label="&brandShortName;"
tooltiptext="&appmenu.title;"
oncommand="PanelUI.toggle(event);"/>
</toolbaritem>
<hbox id="window-controls" hidden="true" pack="end">
@ -970,6 +839,155 @@
# Update primaryToolbarButtons in browser/themes/shared/browser.inc when adding
# or removing default items with the toolbarbutton-1 class.
<toolbaritem id="search-container" title="&searchItem.title;"
align="center" class="chromeclass-toolbar-additional"
flex="100" persist="width" removable="true">
<searchbar id="searchbar" flex="1"/>
</toolbaritem>
<toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
persist="class" removable="true"
label="&homeButton.label;"
ondragover="homeButtonObserver.onDragOver(event)"
ondragenter="homeButtonObserver.onDragOver(event)"
ondrop="homeButtonObserver.onDrop(event)"
ondragexit="homeButtonObserver.onDragExit(event)"
onclick="BrowserGoHome(event);"
aboutHomeOverrideTooltip="&abouthome.pageTitle;"/>
<toolbaritem id="social-toolbar-item"
class="chromeclass-toolbar-additional"
removable="false"
title="&socialToolbar.title;"
hidden="true"
skipintoolbarset="true"
observes="socialActiveBroadcaster">
<toolbarbutton id="social-provider-button"
class="toolbarbutton-1"
type="menu">
<menupopup id="social-statusarea-popup">
<menuitem class="social-statusarea-user menuitem-iconic" pack="start" align="center"
observes="socialBroadcaster_userDetails"
oncommand="SocialUI.showProfile(); document.getElementById('social-statusarea-popup').hidePopup();">
<image class="social-statusarea-user-portrait"
observes="socialBroadcaster_userDetails"/>
<vbox>
<label class="social-statusarea-loggedInStatus"
observes="socialBroadcaster_userDetails"/>
</vbox>
</menuitem>
#ifndef XP_WIN
<menuseparator class="social-statusarea-separator"/>
#endif
<menuitem class="social-toggle-sidebar-menuitem"
type="checkbox"
autocheck="false"
command="Social:ToggleSidebar"
label="&social.toggleSidebar.label;"
accesskey="&social.toggleSidebar.accesskey;"/>
<menuitem class="social-toggle-notifications-menuitem"
type="checkbox"
autocheck="false"
command="Social:ToggleNotifications"
label="&social.toggleNotifications.label;"
accesskey="&social.toggleNotifications.accesskey;"/>
<menuitem class="social-toggle-menuitem" command="Social:Toggle"/>
<menuseparator class="social-statusarea-separator"/>
<menuseparator class="social-provider-menu" hidden="true"/>
<menuitem class="social-addons-menuitem" command="Social:Addons"
label="&social.addons.label;"/>
<menuitem label="&social.learnMore.label;"
accesskey="&social.learnMore.accesskey;"
oncommand="SocialUI.showLearnMore();"/>
</menupopup>
</toolbarbutton>
</toolbaritem>
<toolbaritem id="bookmarks-menu-button-container"
class="chromeclass-toolbar-additional"
removable="true"
title="&bookmarksMenuButton.label;">
<toolbarbutton id="bookmarks-menu-button"
type="menu"
class="toolbarbutton-1"
label="&bookmarksMenuButton.label;"
tooltiptext="&bookmarksMenuButton.tooltip;"
ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
ondragover="PlacesMenuDNDHandler.onDragOver(event);"
ondragexit="PlacesMenuDNDHandler.onDragExit(event);"
ondrop="PlacesMenuDNDHandler.onDrop(event);">
<menupopup id="BMB_bookmarksPopup"
placespopup="true"
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
tooltip="bhTooltip" popupsinherittooltip="true">
<menuitem id="BMB_viewBookmarksToolbar"
placesanonid="view-toolbar"
toolbarId="PersonalToolbar"
type="checkbox"
oncommand="onViewToolbarCommand(event)"
label="&viewBookmarksToolbar.label;"/>
<menuseparator/>
<menuitem id="BMB_bookmarksShowAll"
label="&showAllBookmarks2.label;"
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator/>
<menuitem id="BMB_bookmarkThisPage"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&bookmarkThisPageCmd.label;"
command="Browser:AddBookmarkAs"
key="addBookmarkAsKb"/>
<menuitem id="BMB_subscribeToPageMenuitem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
label="&subscribeToPageMenuitem.label;"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"
observes="singleFeedMenuitemState"/>
<menu id="BMB_subscribeToPageMenupopup"
#ifndef XP_MACOSX
class="menu-iconic"
#endif
label="&subscribeToPageMenupopup.label;"
observes="multipleFeedsMenuState">
<menupopup id="BMB_subscribeToPageSubmenuMenupopup"
onpopupshowing="return FeedHandler.buildFeedList(event.target);"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"/>
</menu>
<menuseparator/>
<menu id="BMB_bookmarksToolbar"
placesanonid="toolbar-autohide"
class="menu-iconic bookmark-item"
label="&personalbarCmd.label;"
container="true">
<menupopup id="BMB_bookmarksToolbarPopup"
placespopup="true"
context="placesContext"
onpopupshowing="if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
</menu>
<menuseparator/>
<!-- Bookmarks menu items -->
<menuseparator builder="end"
class="hide-if-empty-places-result"/>
<menuitem id="BMB_unsortedBookmarks"
label="&bookmarksMenuButton.unsorted.label;"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"
class="menuitem-iconic"/>
</menupopup>
</toolbarbutton>
</toolbaritem>
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&printButton.label;" command="cmd_print"
tooltiptext="&printButton.tooltip;"/>
@ -1076,45 +1094,49 @@
<hbox id="fullscr-toggler" collapsed="true"/>
<hbox flex="1" id="browser">
<vbox id="browser-border-start" hidden="true" layer="true"/>
<vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
<sidebarheader id="sidebar-header" align="center">
<label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
<image id="sidebar-throbber"/>
<toolbarbutton class="tabs-closebutton" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="toggleSidebar();"/>
</sidebarheader>
<browser id="sidebar" flex="1" autoscroll="false" disablehistory="true"
style="min-width: 14em; width: 18em; max-width: 36em;"/>
</vbox>
<deck id="content-deck" flex="1">
<hbox flex="1" id="browser">
<vbox id="browser-border-start" hidden="true" layer="true"/>
<vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
<sidebarheader id="sidebar-header" align="center">
<label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
<image id="sidebar-throbber"/>
<toolbarbutton class="tabs-closebutton" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="toggleSidebar();"/>
</sidebarheader>
<browser id="sidebar" flex="1" autoscroll="false" disablehistory="true"
style="min-width: 14em; width: 18em; max-width: 36em;"/>
</vbox>
<splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" hidden="true"/>
<vbox id="appcontent" flex="1">
<tabbrowser id="content" disablehistory="true"
flex="1" contenttooltip="aHTMLTooltip"
tabcontainer="tabbrowser-tabs"
contentcontextmenu="contentAreaContextMenu"
autocompletepopup="PopupAutoComplete"/>
<chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
<statuspanel id="statusbar-display" inactive="true"/>
</vbox>
<splitter id="social-sidebar-splitter"
class="chromeclass-extrachrome sidebar-splitter"
observes="socialSidebarBroadcaster"/>
<vbox id="social-sidebar-box"
class="chromeclass-extrachrome"
observes="socialSidebarBroadcaster"
persist="width">
<browser id="social-sidebar-browser"
type="content"
context="contentAreaContextMenu"
disableglobalhistory="true"
tooltip="aHTMLTooltip"
flex="1"
style="min-width: 14em; width: 18em; max-width: 36em;"/>
</vbox>
<vbox id="browser-border-end" hidden="true" layer="true"/>
</hbox>
<splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" hidden="true"/>
<vbox id="appcontent" flex="1">
<tabbrowser id="content" disablehistory="true"
flex="1" contenttooltip="aHTMLTooltip"
tabcontainer="tabbrowser-tabs"
contentcontextmenu="contentAreaContextMenu"
autocompletepopup="PopupAutoComplete"
onclick="contentAreaClick(event, false);"/>
<chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
<statuspanel id="statusbar-display" inactive="true"/>
</vbox>
<splitter id="social-sidebar-splitter"
class="chromeclass-extrachrome sidebar-splitter"
observes="socialSidebarBroadcaster"/>
<vbox id="social-sidebar-box"
class="chromeclass-extrachrome"
observes="socialSidebarBroadcaster"
persist="width">
<browser id="social-sidebar-browser"
type="content"
context="contentAreaContextMenu"
disableglobalhistory="true"
tooltip="aHTMLTooltip"
flex="1"
style="min-width: 14em; width: 18em; max-width: 36em;"/>
</vbox>
<vbox id="browser-border-end" hidden="true" layer="true"/>
</hbox>
#include customize.inc
</deck>
<hbox id="full-screen-warning-container" hidden="true" fadeout="true">
<hbox style="width: 100%;" pack="center"> <!-- Inner hbox needed due to bug 579776. -->
@ -1184,38 +1206,34 @@
</toolbar>
</vbox>
#ifndef XP_UNIX
<svg:svg height="0">
<svg:clipPath id="tab-curve-clip-path-start" clipPathUnits="userSpaceOnUse">
<svg:path d="M 30,2 C 17.049,2.104,15.508,11.669,14.511,17 c -1.565,8.376,-4.276,13,-13,13 L 0,31 H 31 V 2 z"/>
</svg:clipPath>
<svg:clipPath id="tab-curve-clip-path-end" clipPathUnits="userSpaceOnUse">
<svg:path d="M -1,2 C 12.951,2.104,14.492,11.669,15.489,17 c +1.565,8.376,+4.276,13,+13,13 L 30,31 H -1 V 2 z"/>
</svg:clipPath>
<svg:clipPath id="tab-clip-path-outer" clipPathUnits="userSpaceOnUse">
<svg:path d="M 30,0 C 24,0 17.78,2.58 15.10,8.09 12.05,13.46 13.14,20.37 9.18,25.3 7.1,27.7 3.8,28 0.8,28 c -0.4,0.6 -2.09,1.11 -1.46,1.80 l 2.45,2.72 61.60,0 2.59,-3.06 C 65.15,28.96 64.57,27.80 63.5,28 60.13,28.13 56.33,27.03 54.74,23.78 51.85,18.44 52.65,11.81 49.09,6.73 45.88,1.65 39.54,-0.26 33.8,0 32.5,0 31.7,0 30,0 z"/>
</svg:clipPath>
#ifndef XP_UNIX
<svg:clipPath id="windows-keyhole-forward-clip-path" clipPathUnits="objectBoundingBox">
<svg:path d="M 0,0 C 0.16,0.11 0.28,0.29 0.28,0.5 0.28,0.71 0.16,0.89 0,1 L 1,1 1,0 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="windows-urlbar-back-button-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="M 0,0 0,7.8 C 2.5,11 4,14 4,18 4,22 2.5,25 0,28 l 0,22 10000,0 0,-50 L 0,0 z"/>
</svg:clipPath>
</svg:svg>
#endif
#ifdef XP_MACOSX
<svg:svg height="0">
<svg:clipPath id="osx-keyhole-forward-clip-path" clipPathUnits="objectBoundingBox">
<svg:path d="M 0,0 C 0.15,0.12 0.25,0.3 0.25,0.5 0.25,0.7 0.15,0.88 0,1 L 1,1 1,0 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-urlbar-back-button-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,-5 0,4.03 C 3.6,1.8 6,6.1 6,11 6,16 3.6,20 0,23 l 0,27 10000,0 0,-55 L 0,-5 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-ontop-left-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="M 9,0 C 7.3,0 6,1.3 6,3 l 0,14 c 0,3 -2.2,5 -5,5 l -1,0 0,1 12,0 0,-1 0,-19 0,-3 -3,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-ontop-right-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,0 0,3 0,19 0,1 12,0 0,-1 -1,0 C 8.2,22 6,20 6,17 L 6,3 C 6,1.3 4.7,0 3,0 L 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-onbottom-left-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,0 0,1 1,0 c 2.8,0 5,2.2 5,5 l 0,14 c 0,2 1.3,3 3,3 l 3,0 0,-3 L 12,1 12,0 0,0 z"/>
</svg:clipPath>
<svg:clipPath id="osx-tab-onbottom-right-curve-clip-path" clipPathUnits="userSpaceOnUse">
<svg:path d="m 0,0 0,1 0,19 0,3 3,0 c 1.7,0 3,-1 3,-3 L 6,6 C 6,3.2 8.2,1 11,1 L 12,1 12,0 0,0 z"/>
</svg:clipPath>
</svg:svg>
#endif
</svg:svg>
</vbox>
# <iframe id="tab-view"> is dynamically appended as the 2nd child of #tab-view-deck.

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

@ -0,0 +1,48 @@
<!-- 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/. -->
<vbox id="customization-container" flex="1" style="background: #DBEAF9;">
<hbox flex="1">
<richlistbox id="customization-categories"
onselect="document.getElementById('customization-content').selectedIndex = this.selectedIndex;">
<richlistitem>
<label value="&customizeMode.menuAndToolbars.label;"/>
</richlistitem>
<richlistitem>
<label value="&customizeMode.appearance.label;"/>
</richlistitem>
</richlistbox>
<deck id="customization-content" flex="1">
<hbox id="customization-widgets">
<vbox flex="1">
<label value="&customizeMode.menuAndToolbars.header;"/>
<vbox id="customization-palette" flex="1"/>
</vbox>
<vbox>
<vbox id="customization-panelWrapper">
<html:style html:type="text/html" scoped="scoped">
@import url(chrome://global/skin/popup.css);
</html:style>
<box class="panel-arrowbox">
<box flex="1"/>
<image class="panel-arrow" side="top"/>
</box>
<box class="panel-arrowcontent" flex="1">
<hbox id="customization-panelHolder"/>
<box class="panel-inner-arrowcontentfooter" hidden="true"/>
</box>
</vbox>
<spacer flex="1"/>
</vbox>
</hbox>
<vbox id="customization-appearance">
<label value="&customizeMode.appearance.header;"/>
</vbox>
</deck>
</hbox>
<hbox pack="end">
<button oncommand="gCustomizeMode.reset();" label="&customizeMode.restoreDefaults;"/>
<button oncommand="BrowserToolboxCustomizeDone();" label="&customizeMode.done;"/>
</hbox>
</vbox>

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

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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 html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&customizeMode.tabTitle;</title>
</head>
<body></body>
</html>

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

@ -9,5 +9,6 @@
<script type="application/javascript" src="chrome://browser/content/browser.js"/>
<script type="application/javascript" src="chrome://browser/content/downloads/downloads.js"/>
<script type="application/javascript" src="chrome://browser/content/downloads/indicator.js"/>
<script type="application/javascript" src="chrome://browser/content/panelUI.js"/>
<script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
<script type="application/javascript" src="chrome://global/content/viewSourceUtils.js"/>

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

@ -0,0 +1,91 @@
<!-- 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/. -->
<panel id="PanelUI-popup"
role="group"
type="arrow"
level="top"
consumeoutsideclicks="true">
<box id="PanelUI-container">
<stack id="PanelUI-viewStack" view="main">
<vbox id="PanelUI-mainView">
<vbox class="PanelUI-pageControls" pack="center">
<hbox class="PanelUI-editControls">
<toolbarbutton id="PanelUI-cut-btn" flex="1"
label="&cutCmd.label;"
tooltiptext="&cutButton.tooltip;"
command="cmd_cut"/>
<toolbarbutton id="PanelUI-copy-btn" flex="1"
label="&copyCmd.label;"
tooltiptext="&copyButton.tooltip;"
command="cmd_copy"/>
<toolbarbutton id="PanelUI-paste-btn" flex="1"
label="&pasteCmd.label;"
tooltiptext="&pasteButton.tooltip;"
command="cmd_paste"/>
</hbox>
<hbox class="PanelUI-zoomControls">
<toolbarbutton id="PanelUI-zoomOut-btn" flex="1"
noautoclose="true" label="&fullZoomReduceCmd.label;"
command="cmd_fullZoomReduce"
tooltiptext="&zoomOutButton.tooltip;"/>
<toolbarbutton id="PanelUI-zoomReset-btn" flex="1"
noautoclose="true" label="&zoomReset.label;"
tooltiptext="&zoomReset.tooltip;"
command="cmd_fullZoomReset"/>
<toolbarbutton id="PanelUI-zoomIn-btn" flex="1"
noautoclose="true" label="&fullZoomEnlargeCmd.label;"
command="cmd_fullZoomEnlarge"
tooltiptext="&zoomInButton.tooltip;"/>
</hbox>
</vbox>
<vbox id="PanelUI-contents" type="grid"/>
<vbox id="PanelUI-mainView-spring"/>
<hbox class="PanelUI-footer" align="center">
<toolbarbutton id="PanelUI-help-btn" label="&helpMenu.label;"
command="openHelpLink('firefox-help');"/>
<spacer flex="1"/>
<toolbarbutton id="PanelUI-customize-btn" label="&appMenuCustomize.label;"
command="cmd_CustomizeToolbars"/>
</hbox>
</vbox>
<!-- Used to capture click events over the PanelUI-mainView if we're in
subview mode. That way, any click on the PanelUI-mainView causes us
to revert to the mainView mode, whereupon PanelUI-click-capture then
allows click events to go through it. -->
<box id="PanelUI-clickCapturer">
</box>
<!-- We manually set display: none (via a CSS attribute selector) on the
subviews that are not being displayed. We're using this over a deck
because a deck assumes the size of its largest child, regardless of
whether or not it is shown. That's not good for our case, since we
want to allow each subview to be uniquely sized. -->
<box id="PanelUI-subViews">
<vbox id="PanelUI-bookmarks" class="PanelUI-subView" flex="1">
<label value="&appMenuBookmarks.label;"/>
<vbox flex="1">
<toolbarbutton label="&bookmarkThisPageCmd.label;"/>
<toolbarbutton label="&viewBookmarksToolbar.label;"/>
<toolbarbutton label="&showAllBookmarks2.label;"/>
<spacer flex="1"/>
</vbox>
<vbox id="PanelUI-bookmarks-tall-maker"/>
</vbox>
<vbox id="PanelUI-history" flex="1">
<label value="&appMenuHistory.label;"/>
<vbox id="PanelUI-historyItems"/>
<label value="&appMenuHistoryMore.label;"
id="PanelUI-historyMore"
class="text-link"
onclick="PlacesCommandHook.showPlacesOrganizer('History'); PanelUI.hide();"/>
</vbox>
</box>
</stack>
</box>
</panel>

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

@ -0,0 +1,281 @@
/* 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/. */
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
/**
* Maintains the state and dispatches events for the main menu panel.
*/
const PanelUI = {
/** Panel events that we listen for. **/
get kEvents() ["popupshowing", "popupshown", "popuphiding", "popuphidden"],
/**
* Used for lazily getting and memoizing elements from the document. Lazy
* getters are set in init, and memoizing happens after the first retrieval.
*/
get kElements() {
return {
clickCapturer: "PanelUI-clickCapturer",
container: "PanelUI-container",
contents: "PanelUI-contents",
mainView: "PanelUI-mainView",
mainViewSpring: "PanelUI-mainView-spring",
menuButton: "PanelUI-menu-button",
panel: "PanelUI-popup",
subViews: "PanelUI-subViews",
viewStack: "PanelUI-viewStack"
};
},
/**
* Returns whether we're in subview mode. This can return true even if
* the transition to subview mode is not yet complete.
**/
get _showingSubView() {
return (this.viewStack.hasAttribute("view") &&
this.viewStack.getAttribute("view") == "subview");
},
init: function() {
for (let [k, v] of Iterator(this.kElements)) {
// Need to do fresh let-bindings per iteration
let getKey = k;
let id = v;
this.__defineGetter__(getKey, function() {
delete this[getKey];
return this[getKey] = document.getElementById(id);
});
}
for (let event of this.kEvents) {
this.panel.addEventListener(event, this);
}
this.clickCapturer.addEventListener("click", this._onCapturerClick,
true);
// Get a MutationObserver ready to react to subview size changes. We
// only attach this MutationObserver when a subview is being displayed.
this._subViewObserver = new MutationObserver(function(aMutations) {
this._syncContainerWithSubView();
}.bind(this));
},
uninit: function() {
for (let event of this.kEvents) {
this.panel.removeEventListener(event, this);
}
this.clickCapturer.removeEventListener("click", this._onCapturerClick,
true);
},
/**
* Customize mode extracts the mainView and puts it somewhere else while the
* user customizes. Upon completion, this function can be called to put the
* panel back to where it belongs in normal browsing mode.
*
* @param aMainView
* The mainView node to put back into place.
*/
replaceMainView: function(aMainView) {
this.viewStack.insertBefore(aMainView, this.viewStack.firstChild);
this._syncContainerWithMainView();
},
/**
* Opens the menu panel if it's closed, or closes it if it's
* open. If the event target has a child with the toolbarbutton-icon
* attribute, the panel will be anchored on that child. Otherwise, the panel
* is anchored on the event target itself.
*
* @param aEvent the event that triggers the toggle.
*/
toggle: function(aEvent) {
if (this.panel.state == "open") {
this.hide();
} else if (this.panel.state == "closed") {
let anchor = aEvent.target;
let iconAnchor =
document.getAnonymousElementByAttribute(anchor, "class",
"toolbarbutton-icon");
this.panel.openPopup(iconAnchor || anchor, "bottomcenter topright");
}
},
/**
* If the menu panel is being shown, hide it.
*/
hide: function() {
this.panel.hidePopup();
},
handleEvent: function(aEvent) {
switch (aEvent.type) {
case "popupshowing":
this.ensureRegistered();
let cstyle = window.getComputedStyle(this.viewStack, null);
this.container.style.height = cstyle.getPropertyValue("height");
this.container.style.width = cstyle.getPropertyValue("width");
// Fall through
case "popupshown":
// Fall through
case "popuphiding":
// Fall through
case "popuphidden": {
this.showMainView();
this._updatePanelButton(aEvent.target);
break;
}
}
},
/**
* Registering the menu panel is done lazily for performance reasons. This
* method is exposed so that CustomizationMode can force registration in the
* event that customization mode is started before the panel has had a chance
* to register itself.
*/
ensureRegistered: function() {
CustomizableUI.registerMenuPanel(this.contents);
},
/**
* Switch the panel to the main view if it's not already
* in that view.
*/
showMainView: function() {
// Are we showing a subview? If so, fire the ViewHiding event on it.
if (this._showingSubView) {
let viewNode = this._currentSubView;
let evt = document.createEvent("CustomEvent");
evt.initCustomEvent("ViewHiding", true, true, viewNode);
viewNode.dispatchEvent(evt);
viewNode.removeAttribute("current");
this._currentSubView = null;
this._subViewObserver.disconnect();
}
this.viewStack.setAttribute("view", "main");
this._syncContainerWithMainView();
this._shiftMainView();
},
/**
* Shows a subview in the panel with a given ID.
*
* @param aViewId the ID of the subview to show.
*/
showSubView: function(aViewId, aAnchor) {
let viewNode = document.getElementById(aViewId);
if (!viewNode) {
Cu.reportError("Could not show panel subview with id: " + aViewId);
return;
}
if (!aAnchor) {
Cu.reportError("Expected an anchor when opening subview with id: " + aViewId);
return;
}
let oldHeight = this.mainView.clientHeight;
viewNode.setAttribute("current", true);
this._currentSubView = viewNode;
// Emit the ViewShowing event so that the widget definition has a chance
// to lazily populate the subview with things.
let evt = document.createEvent("CustomEvent");
evt.initCustomEvent("ViewShowing", true, true, viewNode);
viewNode.dispatchEvent(evt);
this.viewStack.setAttribute("view", "subview");
this.mainViewSpring.style.height = this.subViews.scrollHeight - oldHeight + "px";
this.container.style.height = this.subViews.scrollHeight + "px";
// Now we have to transition to transition the panel. There are a few parts
// to this:
//
// 1) The main view content gets shifted so that the center of the anchor
// node is at the left-most edge of the panel.
// 2) The subview deck slides in so that it takes up almost all of the
// panel.
// 3) If the subview is taller then the main panel contents, then the panel
// must grow to meet that new height. Otherwise, it must shrink.
//
// All three of these actions make use of CSS transformations, so they
// should all occur simultaneously.
this._shiftMainView(aAnchor);
this._subViewObserver.observe(viewNode, {
attributes: true,
characterData: true,
childList: true,
subtree: true
});
},
/**
* Ensures that the container has the same height as the main view, minus
* any spring height. This is usually done after customization completes, or
* when switching back from a subview.
*/
_syncContainerWithMainView: function() {
let springHeight = this.mainViewSpring.getBoundingClientRect().height;
this.container.style.height = (this.mainView.scrollHeight - springHeight) + "px";
this.mainViewSpring.style.height = "";
},
/**
* Ensures that the container has the same height as the subview holder.
* This is usually done when switching to a subview, or if a subview changes
* in size.
*/
_syncContainerWithSubView: function() {
let springHeight = this.mainViewSpring.getBoundingClientRect().height;
let mainViewHeight = this.mainView.clientHeight - springHeight;
this.container.style.height = this.subViews.scrollHeight + "px";
this.mainViewSpring.style.height = (this.subViews.scrollHeight - mainViewHeight) + "px";
},
/**
* Sets the anchor node into the open or closed state, depending
* on the state of the panel.
*/
_updatePanelButton: function() {
this.menuButton.open = this.panel.state == "open" ||
this.panel.state == "showing";
},
/**
* If aAnchor is not null, this shifts the main view content so that it is
* partially clipped by the panel boundaries, placing the center of aAnchor
* at the clipping edge. If aAnchor is undefined or null, the main view
* content is shifted back to its original position.
*/
_shiftMainView: function(aAnchor) {
if (aAnchor) {
// We need to find the left edge of the anchor, relative to the main
// panel. Then we need to add half the width of the anchor. This is the
// target that we need to transition to.
let anchorRect = aAnchor.getBoundingClientRect();
let mainViewRect = this.mainView.getBoundingClientRect();
let leftEdge = anchorRect.left - mainViewRect.left;
let center = (anchorRect.width / 2);
let target = leftEdge + center;
this.mainView.style.transform = "translateX(-" + target + "px)";
} else {
this.mainView.style.transform = "";
}
},
/**
* When viewing a subview, any click on the main view gets intercepted by our
* capturer, and then we switch to the main view.
*/
_onCapturerClick: function(aEvent) {
PanelUI.showMainView();
},
};

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

@ -0,0 +1,40 @@
<?xml version="1.0"?>
<!-- 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/. -->
<bindings id="browserPanelUIBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="toolbarbutton" display="xul:button"
extends="chrome://global/content/bindings/button.xml#button-base">
<resources>
<stylesheet src="chrome://global/skin/toolbarbutton.css"/>
</resources>
<content>
<children includes="observes|template|menupopup|panel|tooltip"/>
<xul:hbox align="center" flex="1">
<xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
<xul:vbox flex="1">
<xul:label class="toolbarbutton-text" crop="right" flex="1"
xbl:inherits="value=label,accesskey,crop"/>
<xul:hbox pack="end">
<xul:label class="toolbarbutton-acceltext" crop="middle"
xbl:inherits="value=acceltext"/>
</xul:hbox>
</xul:vbox>
</xul:hbox>
</content>
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULToolbarButton;
</getter>
</property>
</implementation>
</binding>
</bindings>

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

@ -0,0 +1,9 @@
/* 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/. */
if (typeof XPCOMUtils == "undefined")
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");

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

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!-- 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" >
%brandDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
]>
<?xml-stylesheet href="chrome://browser/skin/panelUIOverlay.css" type="text/css"?>
<overlay id="panelUIOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://browser/content/panelUIOverlay.js"/>
<hbox id="app-extension-point-end">
<toolbarbutton id="PanelUI-menu-button"
class="toolbarbutton-1"
label="&brandShortName;"
tooltiptext="&appmenu.title;"
oncommand="CustomizableUI.showPanel(this);"/>
</hbox>
</overlay>

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

@ -3451,9 +3451,7 @@
if (aEvent.target != window)
break;
let sizemode = document.documentElement.getAttribute("sizemode");
TabsInTitlebar.allowedBy("sizemode",
sizemode == "maximized" || sizemode == "fullscreen");
TabsInTitlebar.updateAppearance();
var width = this.mTabstrip.boxObject.width;
if (width != this.mTabstripWidth) {

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

@ -0,0 +1,104 @@
<?xml version="1.0"?>
<!-- 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/. -->
<bindings id="browserToolbarBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="toolbar">
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULToolbar;
</getter>
</property>
<constructor><![CDATA[
if (document.readyState == "complete") {
this._init();
} else {
// Need to wait until XUL overlays are loaded. See bug 554279.
let self = this;
document.addEventListener("readystatechange", function onReadyStateChange() {
if (document.readyState != "complete")
return;
document.removeEventListener("readystatechange", onReadyStateChange, false);
self._init();
}, false);
}
]]></constructor>
<method name="_init">
<body><![CDATA[
let scope = {};
Cu.import("resource:///modules/CustomizableUI.jsm", scope);
let CustomizableUI = scope.CustomizableUI;
// Searching for the toolbox palette in the toolbar binding because
// toolbars are constructed first.
let toolbox = this.toolbox;
if (toolbox && !toolbox.palette) {
for (let node of toolbox.children) {
if (node.localName == "toolbarpalette") {
// Hold on to the palette but remove it from the document.
toolbox.palette = node;
toolbox.removeChild(node);
}
}
}
CustomizableUI.registerToolbar(this);
]]></body>
</method>
<property name="toolbarName"
onget="return this.getAttribute('toolbarname');"
onset="this.setAttribute('toolbarname', val); return val;"/>
<property name="customizationTarget" readonly="true">
<getter><![CDATA[
if (this._customizationTarget)
return this._customizationTarget;
let id = this.getAttribute("customizationtarget");
if (id)
this._customizationTarget = document.getElementById(id);
if (!this._customizationTarget)
this._customizationTarget = this;
return this._customizationTarget;
]]></getter>
</property>
<property name="toolbox" readonly="true">
<getter><![CDATA[
if (this._toolbox)
return this._toolbox;
let toolboxId = this.getAttribute("toolboxid");
if (toolboxId) {
let toolbox = document.getElementById(toolboxId);
if (toolbox) {
if (toolbox.externalToolbars.indexOf(this) == -1)
toolbox.externalToolbars.push(this);
this._toolbox = toolbox;
}
}
if (!this._toolbox && this.parentNode &&
this.parentNode.localName == "toolbox") {
this._toolbox = this.parentNode;
}
return this._toolbox;
]]></getter>
</property>
</implementation>
</binding>
</bindings>

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

@ -13,8 +13,14 @@ browser.jar:
#endif
% overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul
% overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul
% style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css
% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/
# These overlays should be kept in sync with what pages are in
# XULBrowserWindow.inContentWhitelist in browser.js
% overlay about:addons chrome://browser/content/panelUIOverlay.xul
% overlay about:preferences chrome://browser/content/panelUIOverlay.xul
% overlay about:permissions chrome://browser/content/panelUIOverlay.xul
% overlay about:sync-progress chrome://browser/content/panelUIOverlay.xul
* content/browser/aboutDialog.xul (content/aboutDialog.xul)
* content/browser/aboutDialog.js (content/aboutDialog.js)
content/browser/aboutDialog.css (content/aboutDialog.css)
@ -60,6 +66,7 @@ browser.jar:
* content/browser/browser.xul (content/browser.xul)
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
content/browser/content.js (content/content.js)
content/browser/customizing.xhtml (content/customizing.xhtml)
content/browser/newtab/newTab.xul (content/newtab/newTab.xul)
* content/browser/newtab/newTab.js (content/newtab/newTab.js)
content/browser/newtab/newTab.css (content/newtab/newTab.css)
@ -72,6 +79,9 @@ browser.jar:
content/browser/pageinfo/feeds.xml (content/pageinfo/feeds.xml)
content/browser/pageinfo/permissions.js (content/pageinfo/permissions.js)
content/browser/pageinfo/security.js (content/pageinfo/security.js)
content/browser/panelUI.js (content/panelUI.js)
content/browser/panelUIOverlay.xul (content/panelUIOverlay.xul)
content/browser/panelUIOverlay.js (content/panelUIOverlay.js)
#ifdef MOZ_SERVICES_SYNC
content/browser/sync/aboutSyncTabs.xul (content/sync/aboutSyncTabs.xul)
content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js)
@ -91,6 +101,8 @@ browser.jar:
content/browser/sync/progress.js (content/sync/progress.js)
content/browser/sync/progress.xhtml (content/sync/progress.xhtml)
#endif
content/browser/panelUI.xml (content/panelUI.xml)
content/browser/toolbar.xml (content/toolbar.xml)
content/browser/openLocation.js (content/openLocation.js)
content/browser/openLocation.xul (content/openLocation.xul)
content/browser/safeMode.css (content/safeMode.css)

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

@ -8,7 +8,7 @@
# BrandFullNameInternal is used for some registry and file system values
# instead of BrandFullName and typically should not be modified.
!define BrandFullNameInternal "Nightly"
!define BrandFullNameInternal "UX"
!define CompanyName "mozilla.org"
!define URLInfoAbout "http://www.mozilla.org"
!define URLUpdateInfo "http://www.mozilla.org/projects/firefox"

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

@ -2,4 +2,4 @@
# 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/.
MOZ_APP_DISPLAYNAME=Nightly
MOZ_APP_DISPLAYNAME=UX

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

@ -2,7 +2,7 @@
- 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/. -->
<!ENTITY brandShortName "Nightly">
<!ENTITY brandFullName "Nightly">
<!ENTITY brandShortName "UX">
<!ENTITY brandFullName "UX">
<!ENTITY vendorShortName "Mozilla">
<!ENTITY trademarkInfo.part1 " ">

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

@ -2,8 +2,8 @@
# 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/.
brandShortName=Nightly
brandFullName=Nightly
brandShortName=UX
brandFullName=UX
vendorShortName=Mozilla
syncBrandShortName=Sync

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

@ -84,6 +84,8 @@ static RedirEntry kRedirMap[] = {
{ "healthreport", "chrome://browser/content/abouthealthreport/abouthealth.xhtml",
nsIAboutModule::ALLOW_SCRIPT },
#endif
{ "customizing", "chrome://browser/content/customizing.xhtml",
nsIAboutModule::ALLOW_SCRIPT },
};
static const int kRedirTotal = NS_ARRAY_LENGTH(kRedirMap);

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

@ -107,6 +107,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
#ifdef MOZ_SERVICES_HEALTHREPORT
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "healthreport", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "customizing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
#if defined(XP_WIN)
{ NS_IEHISTORYENUMERATOR_CONTRACTID, &kNS_WINIEHISTORYENUMERATOR_CID },
#elif defined(XP_MACOSX)

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

@ -15,6 +15,8 @@
inside the private browsing mode -->
<!ENTITY mainWindow.titlePrivateBrowsingSuffix "(Private Browsing)">
<!ENTITY appmenu.title "Customize and Control &brandFullName;">
<!-- Tab context menu -->
<!ENTITY reloadTab.label "Reload Tab">
<!ENTITY reloadTab.accesskey "R">
@ -319,6 +321,10 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY appMenuGettingStarted.label "Getting Started">
<!ENTITY appMenuSafeMode.label "Restart with Add-ons Disabled…">
<!ENTITY appMenuSafeMode.accesskey "R">
<!ENTITY appMenuBack.label "Back">
<!ENTITY appMenuBookmarks.label "Bookmarks">
<!ENTITY appMenuHistory.label "History">
<!ENTITY appMenuHistoryMore.label "More…">
<!ENTITY openCmd.commandkey "l">
<!ENTITY urlbar.placeholder2 "Search or enter address">
@ -530,6 +536,9 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY zoomOutButton.tooltip "Zoom out">
<!ENTITY zoomInButton.tooltip "Zoom in">
<!ENTITY zoomControls.label "Zoom Controls">
<!ENTITY zoomReset.tooltip "Reset Zoom">
<!-- LOCALIZATION NOTE(zoomReset.label): the &#37; is the percent symbol. -->
<!ENTITY zoomReset.label "100&#37;">
<!ENTITY quitApplicationCmdWin.label "Exit">
<!ENTITY quitApplicationCmdWin.accesskey "x">
@ -639,6 +648,16 @@ just addresses the organization to follow, e.g. "This site is run by " -->
<!ENTITY social.learnMore.accesskey "l">
<!ENTITY social.closeNotificationItem.label "Not Now">
<!ENTITY customizeMode.tabTitle "Customize &brandShortName;">
<!ENTITY customizeMode.menuAndToolbars.label "Menu and toolbars">
<!ENTITY customizeMode.menuAndToolbars.header "More tools to add to the menu and toolbar">
<!ENTITY customizeMode.appearance.label "Appearance">
<!ENTITY customizeMode.appearance.header "Bling!">
<!ENTITY customizeMode.restoreDefaults "Restore Defaults">
<!ENTITY customizeMode.done "Done">
<!ENTITY social.chatBar.commandkey "c">
<!ENTITY social.chatBar.label "Focus chats">
<!ENTITY social.chatBar.accesskey "c">

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,724 @@
/* 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/. */
"use strict";
this.EXPORTED_SYMBOLS = ["CustomizeMode"];
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const kPrefCustomizationDebug = "browser.uiCustomization.debug";
const kPaletteId = "customization-palette";
const kAboutURI = "about:customizing";
let gDebug = false;
try {
gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
} catch (e) {}
function LOG(str) {
if (gDebug) {
Services.console.logStringMessage(str);
}
}
function ERROR(aMsg) Cu.reportError("[CustomizeMode] " + aMsg);
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/CustomizableUI.jsm");
function CustomizeMode(aWindow) {
this.window = aWindow;
this.document = aWindow.document;
this.browser = aWindow.gBrowser;
};
CustomizeMode.prototype = {
_changed: false,
window: null,
document: null,
// areas is used to cache the customizable areas when in customization mode.
areas: null,
// When in customizing mode, we swap out the reference to the invisible
// palette in gNavToolbox.palette for our visiblePalette. This way, for the
// customizing browser window, when widgets are removed from customizable
// areas and added to the palette, they're added to the visible palette.
// _stowedPalette is a reference to the old invisible palette so we can
// restore gNavToolbox.palette to its original state after exiting
// customization mode.
_stowedPalette: null,
_dragOverItem: null,
_customizing: false,
init: function() {
// There are two palettes - there's the palette that can be overlayed with
// toolbar items in browser.xul. This is invisible, and never seen by the
// user. Then there's the visible palette, which gets populated and displayed
// to the user when in customizing mode.
this.visiblePalette = this.document.getElementById(kPaletteId);
this.browser.tabContainer.addEventListener("TabSelect", this, false);
this.browser.addTabsProgressListener(this);
},
uninit: function() {
this.browser.tabContainer.removeEventListener("TabSelect", this, false);
this.browser.removeTabsProgressListener(this);
},
enter: function() {
let window = this.window;
let document = this.document;
// We don't need to switch to kAboutURI, or open a new tab at
// kAboutURI if we're already on it.
if (this.browser.selectedBrowser.currentURI.spec != kAboutURI) {
this.window.switchToTabHavingURI(kAboutURI, true);
}
CustomizableUI.addListener(this);
// The menu panel is lazy, and registers itself when the popup shows. We
// need to force the menu panel to register itself, or else customization
// is really not going to work.
window.PanelUI.ensureRegistered();
// Add a keypress listener and click listener to the tab-view-deck so that
// we can quickly exit customization mode when pressing ESC or clicking on
// the blueprint outside the customization container.
let deck = document.getElementById("tab-view-deck");
deck.addEventListener("keypress", this, false);
deck.addEventListener("click", this, false);
// Same goes for the menu button - if we're customizing, a click to the
// menu button means a quick exit from customization mode.
window.PanelUI.menuButton.addEventListener("click", this, false);
window.PanelUI.menuButton.disabled = true;
// Let everybody in this window know that we're about to customize.
let evt = document.createEvent("CustomEvent");
evt.initCustomEvent("CustomizationStart", true, true, window);
window.dispatchEvent(evt);
let customizer = document.getElementById("customization-container");
customizer.parentNode.selectedPanel = customizer;
window.PanelUI.hide();
// Move the mainView in the panel to the holder so that we can see it
// while customizing.
let panelHolder = document.getElementById("customization-panelHolder");
panelHolder.appendChild(window.PanelUI.mainView);
let self = this;
deck.addEventListener("transitionend", function customizeTransitionEnd() {
deck.removeEventListener("transitionend", customizeTransitionEnd);
// Add drag-and-drop event handlers to all of the customizable areas.
self.areas = [];
for (let area of CustomizableUI.areas) {
let target = CustomizableUI.getCustomizeTargetForArea(area, window);
target.addEventListener("dragstart", self);
target.addEventListener("dragover", self);
target.addEventListener("dragexit", self);
target.addEventListener("drop", self);
for (let child of target.children) {
self.wrapToolbarItem(child, getPlaceForItem(child));
}
self.areas.push(target);
}
self.populatePalette();
});
this.visiblePalette.addEventListener("dragstart", this);
this.visiblePalette.addEventListener("dragover", this);
this.visiblePalette.addEventListener("dragexit", this);
this.visiblePalette.addEventListener("drop", this);
document.documentElement.setAttribute("customizing", true);
this._customizing = true;
},
exit: function() {
CustomizableUI.removeListener(this);
let deck = this.document.getElementById("tab-view-deck");
deck.removeEventListener("keypress", this, false);
deck.removeEventListener("click", this, false);
this.window.PanelUI.menuButton.removeEventListener("click", this, false);
this.window.PanelUI.menuButton.disabled = false;
this.depopulatePalette();
this.visiblePalette.removeEventListener("dragstart", this);
this.visiblePalette.removeEventListener("dragover", this);
this.visiblePalette.removeEventListener("dragexit", this);
this.visiblePalette.removeEventListener("drop", this);
let window = this.window;
let document = this.document;
if (this._changed) {
// XXXmconley: At first, it seems strange to also persist the old way with
// currentset - but this might actually be useful for switching
// to old builds. We might want to keep this around for a little
// bit.
this.persistCurrentSets();
}
document.documentElement.removeAttribute("customizing");
for (let target of this.areas) {
for (let toolbarItem of target.children) {
this.unwrapToolbarItem(toolbarItem);
}
target.removeEventListener("dragstart", this);
target.removeEventListener("dragover", this);
target.removeEventListener("dragexit", this);
target.removeEventListener("drop", this);
}
// And drop all area references.
this.areas = [];
// Let everybody in this window know that we're finished customizing.
let evt = document.createEvent("CustomEvent");
evt.initCustomEvent("CustomizationEnd", true, true, {changed: this._changed});
window.dispatchEvent(evt);
window.PanelUI.replaceMainView(window.PanelUI.mainView);
let browser = document.getElementById("browser");
browser.parentNode.selectedPanel = browser;
if (this.browser.selectedBrowser.currentURI.spec == kAboutURI) {
let custBrowser = this.browser.selectedBrowser;
if (custBrowser.canGoBack) {
// If there's history to this tab, just go back.
custBrowser.goBack();
} else {
let customizationTab = this.browser.selectedTab;
if (this.browser.browsers.length == 1) {
this.window.BrowserOpenTab();
}
this.browser.removeTab(customizationTab);
}
}
this._changed = false;
this._customizing = false;
},
populatePalette: function() {
let toolboxPalette = this.window.gNavToolbox.palette;
let unusedWidgets = CustomizableUI.getUnusedWidgets(toolboxPalette);
for (let widget of unusedWidgets) {
let paletteItem = this.makePaletteItem(widget, "palette");
this.visiblePalette.appendChild(paletteItem);
}
this._stowedPalette = this.window.gNavToolbox.palette;
this.window.gNavToolbox.palette = this.visiblePalette;
},
//XXXunf Maybe this should use -moz-element instead of wrapping the node?
// Would ensure no weird interactions/event handling from original node,
// and makes it possible to put this in a lazy-loaded iframe/real tab
// while still getting rid of the need for overlays.
makePaletteItem: function(aWidget, aPlace) {
let widgetNode = aWidget.forWindow(this.window).node;
let wrapper = this.createWrapper(widgetNode, aPlace);
wrapper.appendChild(widgetNode);
return wrapper;
},
depopulatePalette: function() {
let wrapper = this.visiblePalette.firstChild;
while (wrapper) {
let widgetNode = wrapper.firstChild;
let provider = CustomizableUI.getWidget(widgetNode.id);
// If provider is PROVIDER_SPECIAL, then it just gets thrown away.
if (provider = CustomizableUI.PROVIDER_XUL) {
if (wrapper.hasAttribute("itemdisabled")) {
widgetNode.disabled = true;
}
if (wrapper.hasAttribute("itemchecked")) {
widgetNode.checked = true;
}
if (wrapper.hasAttribute("itemcommand")) {
let commandID = wrapper.getAttribute("itemcommand");
widgetNode.setAttribute("command", commandID);
// Ensure node is in sync with its command after customizing.
let command = this.document.getElementById(commandID);
if (command && command.hasAttribute("disabled")) {
widgetNode.setAttribute("disabled",
command.getAttribute("disabled"));
}
}
this._stowedPalette.appendChild(widgetNode);
} else if (provider = CustomizableUI.PROVIDER_API) {
//XXXunf Currently this doesn't destroy the (now unused) node. It would
// be good to do so, but we need to keep strong refs to it in
// CustomizableUI (can't iterate of WeakMaps), and there's the
// question of what behavior wrappers should have if consumers
// keep hold of them.
//widget.destroyInstance(widgetNode);
}
this.visiblePalette.removeChild(wrapper);
wrapper = this.visiblePalette.firstChild;
}
this.window.gNavToolbox.palette = this._stowedPalette;
},
wrapToolbarItem: function(aNode, aPlace) {
let wrapper = this.createWrapper(aNode, aPlace);
// It's possible that this toolbar node is "mid-flight" and doesn't have
// a parent, in which case we skip replacing it. This can happen if a
// toolbar item has been dragged into the palette. In that case, we tell
// CustomizableUI to remove the widget from its area before putting the
// widget in the palette - so the node will have no parent.
if (aNode.parentNode) {
aNode = aNode.parentNode.replaceChild(wrapper, aNode);
}
wrapper.appendChild(aNode);
return wrapper;
},
createWrapper: function(aNode, aPlace) {
let wrapper = this.document.createElement("toolbarpaletteitem");
// "place" is used by toolkit to add the toolbarpaletteitem-palette
// binding to a toolbarpaletteitem, which gives it a label node for when
// it's sitting in the palette.
wrapper.setAttribute("place", aPlace);
// Ensure the wrapped item doesn't look like it's in any special state, and
// can't be interactved with when in the customization palette.
if (aNode.hasAttribute("command")) {
wrapper.setAttribute("itemcommand", aNode.getAttribute("command"));
aNode.removeAttribute("command");
}
if (aNode.checked) {
wrapper.setAttribute("itemchecked", "true");
aNode.checked = false;
}
if (aNode.disabled) {
wrapper.setAttribute("itemdisabled", "true");
aNode.disabled = false;
}
if (aNode.hasAttribute("id")) {
wrapper.setAttribute("id", "wrapper-" + aNode.getAttribute("id"));
}
if (aNode.hasAttribute("title")) {
wrapper.setAttribute("title", aNode.getAttribute("title"));
} else if (aNode.hasAttribute("label")) {
wrapper.setAttribute("title", aNode.getAttribute("label"));
}
if (aNode.hasAttribute("flex")) {
wrapper.setAttribute("flex", aNode.getAttribute("flex"));
}
wrapper.addEventListener("mousedown", this);
wrapper.addEventListener("mouseup", this);
return wrapper;
},
unwrapToolbarItem: function(aWrapper) {
aWrapper.removeEventListener("mousedown", this);
aWrapper.removeEventListener("mouseup", this);
let toolbarItem = aWrapper.firstChild;
if (aWrapper.hasAttribute("itemdisabled")) {
toolbarItem.disabled = true;
}
if (aWrapper.hasAttribute("itemchecked")) {
toolbarItem.checked = true;
}
if (aWrapper.hasAttribute("itemcommand")) {
let commandID = aWrapper.getAttribute("itemcommand");
toolbarItem.setAttribute("command", commandID);
//XXX Bug 309953 - toolbarbuttons aren't in sync with their commands after customizing
let command = this.document.getElementById(commandID);
if (command && command.hasAttribute("disabled")) {
toolbarItem.setAttribute("disabled", command.getAttribute("disabled"));
}
}
if (aWrapper.parentNode) {
aWrapper.parentNode.replaceChild(toolbarItem, aWrapper);
}
return toolbarItem;
},
//XXXjaws This doesn't handle custom toolbars.
//XXXmconley While CustomizableUI.jsm uses prefs to preserve state, we might
// also want to (try) persisting with currentset as well to make it
// less painful to switch to older builds.
persistCurrentSets: function() {
//XXXjaws The toolbar bindings that are included in this changeset (/browser/base/content/toolbar.xml)
// don't implement currentSet. They probably need to inherit the toolkit bindings.
return;
let document = this.document;
let toolbar = document.getElementById("nav-bar");
// Calculate currentset and store it in the attribute.
let currentSet = toolbar.currentSet;
toolbar.setAttribute("currentset", currentSet);
// Persist the currentset attribute directly on hardcoded toolbars.
document.persist(toolbar.id, "currentset");
},
reset: function() {
CustomizableUI.reset();
},
onWidgetMoved: function(aWidgetId, aArea, aOldPosition, aNewPosition) {
this._changed = true;
},
onWidgetAdded: function(aWidgetId, aArea, aPosition) {
this._changed = true;
},
onWidgetRemoved: function(aWidgetId, aArea) {
this._changed = true;
},
onWidgetCreated: function(aWidgetId) {
},
onWidgetDestroyed: function(aWidgetId) {
},
handleEvent: function(aEvent) {
switch(aEvent.type) {
case "dragstart":
this._onDragStart(aEvent);
break;
case "dragover":
this._onDragOver(aEvent);
break;
case "drop":
this._onDragDrop(aEvent);
break;
case "dragexit":
this._onDragExit(aEvent);
break;
case "mousedown":
this._onMouseDown(aEvent);
break;
case "mouseup":
this._onMouseUp(aEvent);
break;
case "keypress":
if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
this.exit();
}
break;
case "click":
if (aEvent.button == 0 &&
(aEvent.originalTarget == this.window.PanelUI.menuButton) ||
(aEvent.originalTarget == this.document.getElementById("tab-view-deck"))) {
this.exit();
aEvent.preventDefault();
}
break;
case "TabSelect":
this._onTabSelect(aEvent);
break;
}
},
_onDragStart: function(aEvent) {
__dumpDragData(aEvent);
let item = aEvent.target;
while (item && item.localName != "toolbarpaletteitem") {
if (item.localName == "toolbar") {
return;
}
item = item.parentNode;
}
let dt = aEvent.dataTransfer;
let documentId = aEvent.target.ownerDocument.documentElement.id;
dt.setData("text/toolbarwrapper-id/" + documentId, item.firstChild.id);
dt.effectAllowed = "move";
},
_onDragOver: function(aEvent) {
__dumpDragData(aEvent);
let document = aEvent.target.ownerDocument;
let documentId = document.documentElement.id;
if (!aEvent.dataTransfer.types.contains("text/toolbarwrapper-id/"
+ documentId.toLowerCase())) {
return;
}
let draggedItemId = aEvent.dataTransfer.getData("text/toolbarwrapper-id/" + documentId);
let draggedWrapper = document.getElementById("wrapper-" + draggedItemId);
let targetNode = aEvent.target;
let targetParent = targetNode.parentNode;
let targetArea = this._getCustomizableParent(targetNode);
let originArea = this._getCustomizableParent(draggedWrapper);
// Do nothing if the target or origin are not customizable.
if (!targetArea || !originArea) {
gCurrentDragOverItem = null;
return;
}
// We need to determine the place that the widget is being dropped in
// the target.
let position = Array.indexOf(targetParent.children, targetNode);
let dragOverItem = position == -1 ? targetParent.lastChild : targetParent.children[position];
if (this._dragOverItem && dragOverItem != this._dragOverItem) {
this._setDragActive(this._dragOverItem, false);
}
// XXXjaws Only handling the toolbar case first.
if (targetArea.localName == "toolbar") {
this._setDragActive(dragOverItem, true);
}
this._dragOverItem = dragOverItem;
aEvent.preventDefault();
aEvent.stopPropagation();
},
_onDragDrop: function(aEvent) {
__dumpDragData(aEvent);
this._setDragActive(this._dragOverItem, false);
let document = aEvent.target.ownerDocument;
let documentId = document.documentElement.id;
let draggedItemId = aEvent.dataTransfer.getData("text/toolbarwrapper-id/" + documentId);
let draggedWrapper = document.getElementById("wrapper-" + draggedItemId);
draggedWrapper.removeAttribute("mousedown");
let targetNode = aEvent.target;
let targetParent = targetNode.parentNode;
let targetArea = this._getCustomizableParent(targetNode);
let originArea = this._getCustomizableParent(draggedWrapper);
// Do nothing if the target area or origin area are not customizable.
if (!targetArea || !originArea) {
return;
}
// Is the target area the customization palette? If so, we have two cases -
// either the originArea was the palette, or a customizable area.
if (targetArea.id == kPaletteId) {
if (originArea.id !== kPaletteId) {
let widget = this.unwrapToolbarItem(draggedWrapper);
CustomizableUI.removeWidgetFromArea(draggedItemId);
draggedWrapper = this.wrapToolbarItem(widget, "palette");
}
// If the targetNode is the palette itself, just append
if (targetNode == this.visiblePalette) {
this.visiblePalette.appendChild(draggedWrapper);
} else {
this.visiblePalette.insertBefore(draggedWrapper, targetNode);
}
return;
}
// Is the target the customization area itself? If so, we just add the
// widget to the end of the area.
if (targetNode == targetArea.customizationTarget) {
let widget = this.unwrapToolbarItem(draggedWrapper);
CustomizableUI.addWidgetToArea(draggedItemId, targetArea.id);
this.wrapToolbarItem(widget, getPlaceForItem(targetNode));
return;
}
// We need to determine the place that the widget is being dropped in
// the target.
let placement = CustomizableUI.getPlacementOfWidget(targetNode.firstChild.id);
if (!placement) {
ERROR("Could not get a position for " + targetNode.firstChild.id);
return;
}
let position = placement.position;
// Is the target area the same as the origin? Since we've already handled
// the possibility that the target is the customization palette, we know
// that the widget is moving within a customizable area.
if (targetArea == originArea) {
let properPlace = getPlaceForItem(targetNode);
// We unwrap the moving widget, as well as the widget that we're dropping
// on (the target) so that moveWidgetWithinArea can correctly insert the
// moving widget before the target widget.
let widget = this.unwrapToolbarItem(draggedWrapper);
let targetWidget = this.unwrapToolbarItem(targetNode);
CustomizableUI.moveWidgetWithinArea(draggedItemId, position);
this.wrapToolbarItem(targetWidget, properPlace);
this.wrapToolbarItem(widget, properPlace);
return;
}
// A little hackery - we quickly unwrap the item and use CustomizableUI's
// addWidgetToArea to move the widget to the right place for every window,
// then we re-wrap the widget. We have to unwrap the target widget too so
// that addWidgetToArea inserts the new widget into the right place.
let properPlace = getPlaceForItem(targetNode);
let widget = this.unwrapToolbarItem(draggedWrapper);
let targetWidget = this.unwrapToolbarItem(targetNode);
CustomizableUI.addWidgetToArea(draggedItemId, targetArea.id, position);
this.wrapToolbarItem(targetWidget, properPlace);
draggedWrapper = this.wrapToolbarItem(widget, properPlace);
},
_onDragExit: function(aEvent) {
if (this._dragOverItem) {
this._setDragActive(this._dragOverItem, false);
}
},
// XXXjaws Show a ghost image or blank area where the item could be added, instead of black bar
_setDragActive: function(aItem, aValue) {
let node = aItem;
let window = aItem.ownerDocument.defaultView;
let direction = window.getComputedStyle(aItem, null).direction;
let value = direction == "ltr"? "left" : "right";
if (aItem.localName == "toolbar") {
node = aItem.lastChild;
value = direction == "ltr"? "right" : "left";
}
if (!node) {
return;
}
if (aValue) {
if (!node.hasAttribute("dragover")) {
node.setAttribute("dragover", value);
}
} else {
node.removeAttribute("dragover");
}
},
_getCustomizableParent: function(aElement) {
let areas = CustomizableUI.areas;
areas.push(kPaletteId);
while (aElement) {
if (areas.indexOf(aElement.id) != -1) {
return aElement;
}
aElement = aElement.parentNode;
}
return null;
},
_onMouseDown: function(aEvent) {
let item = this._getWrapper(aEvent.target);
if (item) {
item.setAttribute("mousedown", "true");
}
},
_onMouseUp: function(aEvent) {
let item = this._getWrapper(aEvent.target);
if (item) {
item.removeAttribute("mousedown");
}
},
_getWrapper: function(aElement) {
while (aElement && aElement.localName != "toolbarpaletteitem") {
if (aElement.localName == "toolbar")
return null;
aElement = aElement.parentNode;
}
return aElement;
},
_onTabSelect: function(aEvent) {
this._toggleCustomizationModeIfNecessary();
},
onLocationChange: function(aBrowser, aProgress, aRequest, aLocation, aFlags) {
if (this.browser.selectedBrowser != aBrowser) {
return;
}
this._toggleCustomizationModeIfNecessary();
},
/**
* Looks at the currently selected browser tab, and if the location
* is set to kAboutURI and we're not customizing, enters customize mode.
* If we're not at kAboutURI and we are customizing, exits customize mode.
*/
_toggleCustomizationModeIfNecessary: function() {
let browser = this.browser.selectedBrowser;
if (browser.currentURI.spec == kAboutURI &&
!this._customizing) {
this.enter();
} else if (browser.currentURI.spec != kAboutURI &&
this._customizing) {
this.exit();
}
}
};
function getPlaceForItem(aElement) {
let place;
let node = aElement;
while (node && !place) {
if (node.localName == "toolbar")
place = "toolbar";
else if (node.id == CustomizableUI.AREA_PANEL)
place = "panel";
else if (node.id == kPaletteId)
place = "palette";
node = node.parentNode;
}
return place;
}
function __dumpDragData(aEvent, caller) {
let str = "Dumping drag data (CustomizeMode.jsm) {\n";
str += " type: " + aEvent["type"] + "\n";
for (let el of ["target", "currentTarget", "relatedTarget"]) {
if (aEvent[el]) {
str += " " + el + ": " + aEvent[el] + "(localName=" + aEvent[el].localName + "; id=" + aEvent[el].id + ")\n";
}
}
for (let prop in aEvent.dataTransfer) {
if (typeof aEvent.dataTransfer[prop] != "function") {
str += " dataTransfer[" + prop + "]: " + aEvent.dataTransfer[prop] + "\n";
}
}
str += "}";
LOG(str);
}

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

@ -13,6 +13,8 @@ include $(topsrcdir)/config/config.mk
EXTRA_JS_MODULES = \
BrowserNewTabPreloader.jsm \
CustomizableUI.jsm \
CustomizeMode.jsm \
openLocationLastURL.jsm \
NetworkPrioritizer.jsm \
offlineAppCache.jsm \

Двоичные данные
browser/themes/linux/appmenu.png Normal file

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

После

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

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

@ -12,7 +12,8 @@
%include ../shared/browser.inc
%filter substitution
%define toolbarHighlight rgba(255,255,255,.3)
%define selectedTabHighlight rgba(255,255,255,.8) 1px, rgba(255,255,255,.5) 3px
%define fgTabTexture linear-gradient(transparent 0px, transparent 1px, hsla(0,0%,100%,0.35) 1px, hsla(0,0%,100%,0.35) 2px, hsla(0,0%,100%,0.65) 2px, hsla(0,0%,100%,0.65) 3px, @toolbarHighlight@)
%define fgTabBackgroundMiddle @fgTabTexture@, linear-gradient(transparent 0px, transparent 2px, -moz-dialog 2px, -moz-dialog)
%define forwardTransitionLength 150ms
%define conditionalForwardWithUrlbar window:not([chromehidden~=toolbar]) :-moz-any(#nav-bar[currentset*="unified-back-forward-button,urlbar-container"][mode=icons], #nav-bar:not([currentset])[mode=icons]) > #unified-back-forward-button
%define conditionalForwardWithUrlbar_small window:not([chromehidden~=toolbar]) :-moz-any(#nav-bar[currentset*="unified-back-forward-button,urlbar-container"][mode=icons][iconsize=small],#nav-bar:not([currentset])[mode=icons][iconsize=small]) > #unified-back-forward-button
@ -1573,6 +1574,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
/* Tabstrip */
%include ../shared/tabs.inc.css
#TabsToolbar {
min-height: 0;
padding: 0;
@ -1588,84 +1591,15 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
}
#TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) > #tabbrowser-tabs > .tabbrowser-tab:not([selected]) {
color: -moz-menubartext;
}
#TabsToolbar[tabsontop=false] {
background-image: linear-gradient(to top, rgba(0,0,0,.3) 1px, rgba(0,0,0,.05) 1px, transparent 50%);
}
.tabbrowser-tab,
.tabs-newtab-button {
position: static;
-moz-appearance: none;
background: linear-gradient(hsla(0,0%,100%,.2), hsla(0,0%,45%,.2) 2px, hsla(0,0%,32%,.2) 80%);
background-origin: border-box;
background-position: 1px 2px;
background-size: 100% calc(100% - 2px);
background-repeat: no-repeat;
color: inherit;
margin: 0;
padding: 0;
border-width: 4px 5px 3px 6px;
border-style: solid;
border-image: url(tabbrowser/tab.png) 4 5 3 6 fill repeat stretch;
border-radius: 10px 8px 0 0;
min-height: 25px; /* reserve space for the sometimes hidden close button */
}
.tabbrowser-tab:hover,
.tabs-newtab-button:hover {
background-image: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.2) 4px, hsla(0,0%,75%,.2) 80%);
}
.tabbrowser-tab[selected="true"] {
background-image: linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%),
linear-gradient(-moz-dialog, -moz-dialog);
color: -moz-dialogtext;
}
#main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
background-image: linear-gradient(to top, rgba(0,0,0,.3) 1px, transparent 1px),
linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%),
linear-gradient(-moz-dialog, -moz-dialog);
}
.tabbrowser-tab[selected="true"]:-moz-lwtheme {
background-image: linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%);
color: inherit;
}
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]),
.tabs-newtab-button:-moz-lwtheme-brighttext {
background-image: linear-gradient(hsla(0,0%,60%,.6), hsla(0,0%,40%,.6) 4px, hsla(0,0%,30%,.6) 80%);
}
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]):hover,
.tabs-newtab-button:-moz-lwtheme-brighttext:hover {
background-image: linear-gradient(hsla(0,0%,80%,.6), hsla(0,0%,60%,.6) 4px, hsla(0,0%,45%,.6) 80%);
}
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]),
.tabs-newtab-button:-moz-lwtheme-darktext {
background-image: linear-gradient(hsla(0,0%,100%,.5), hsla(0,0%,60%,.5) 4px, hsla(0,0%,45%,.5) 80%);
}
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]):hover,
.tabs-newtab-button:-moz-lwtheme-darktext:hover {
background-image: linear-gradient(hsla(0,0%,100%,.5), hsla(0,0%,80%,.5) 4px, hsla(0,0%,60%,.5) 80%);
}
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
background-image: radial-gradient(circle farthest-corner at 50% 3px, rgba(233,242,252,1) 3%, rgba(172,206,255,.75) 40%, rgba(87,151,201,.5) 80%, rgba(87,151,201,0));
}
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]):hover {
background-image: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.6) 2px, hsla(0,0%,75%,.2) 80%),
radial-gradient(circle farthest-corner at 50% 3px, rgba(233,242,252,1) 3%, rgba(172,206,255,.75) 40%, rgba(87,151,201,.5) 80%, rgba(87,151,201,0));
}
#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab > .tab-stack > .tab-content[pinned] {
min-height: 18px; /* corresponds to the max. height of non-textual tab contents, i.e. the tab close button */
}
.tabbrowser-tab:focus > .tab-stack {
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
outline: 1px dotted;
}
@ -2232,6 +2166,12 @@ chatbox {
border-top-right-radius: 2.5px;
}
/* Customization mode */
%include ../shared/customization.inc.css
/* End customization mode */
.click-to-play-plugins-notification-content {
margin: -10px;
}

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

После

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

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

@ -18,8 +18,10 @@ browser.jar:
skin/classic/browser/aboutSyncTabs.css
#endif
skin/classic/browser/actionicon-tab.png
skin/classic/browser/appmenu.png
* skin/classic/browser/browser.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/customization/customization-mode-background.jpg (customization/customization-mode-background.jpg)
* skin/classic/browser/engineManager.css
skin/classic/browser/Geolocation-16.png
skin/classic/browser/Geolocation-64.png
@ -39,6 +41,7 @@ browser.jar:
* skin/classic/browser/pageInfo.css
skin/classic/browser/pageInfo.png
skin/classic/browser/page-livemarks.png
* skin/classic/browser/panelUIOverlay.css
skin/classic/browser/pointerLock-16.png
skin/classic/browser/pointerLock-64.png
skin/classic/browser/Privacy-16.png
@ -108,8 +111,14 @@ browser.jar:
skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png)
skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/browser/tabbrowser/tab.png (tabbrowser/tab.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/browser/tabbrowser/tab-background-middle.png (tabbrowser/tab-background-middle.png)
skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
skin/classic/browser/tabbrowser/tab-stroke-end.png (tabbrowser/tab-stroke-end.png)
skin/classic/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/tabview/edit-light.png (tabview/edit-light.png)
skin/classic/browser/tabview/search.png (tabview/search.png)
skin/classic/browser/tabview/stack-expander.png (tabview/stack-expander.png)

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

@ -0,0 +1,41 @@
/* 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/. */
%filter substitution
%define menuPanelWidth 21em
%include ../shared/panelUIOverlay.inc.css
#PanelUI-cut-btn {
list-style-image: url("moz-icon://stock/gtk-cut?size=toolbar");
}
#PanelUI-cut-btn[disabled="true"] {
list-style-image: url("moz-icon://stock/gtk-cut?size=toolbar&state=disabled");
}
#PanelUI-copy-btn {
list-style-image: url("moz-icon://stock/gtk-copy?size=toolbar");
}
#PanelUI-copy-btn[disabled="true"] {
list-style-image: url("moz-icon://stock/gtk-copy?size=toolbar&state=disabled");
}
#PanelUI-paste-btn {
list-style-image: url("moz-icon://stock/gtk-paste?size=toolbar");
}
#PanelUI-paste-btn[disabled="true"] {
list-style-image: url("moz-icon://stock/gtk-paste?size=toolbar&state=disabled");
}
#PanelUI-zoomOut-btn {
list-style-image: url("moz-icon://stock/gtk-zoom-out?size=toolbar");
padding-left: 12px;
padding-right: 12px;
}
#PanelUI-zoomIn-btn {
list-style-image: url("moz-icon://stock/gtk-zoom-in?size=toolbar");
padding-left: 12px;
padding-right: 12px;
}

Двоичные данные
browser/themes/linux/tabbrowser/tab-active-middle.png Normal file

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

После

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

Двоичные данные
browser/themes/linux/tabbrowser/tab-background-end.png Normal file

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

После

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

Двоичные данные
browser/themes/linux/tabbrowser/tab-background-middle.png Normal file

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

После

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

Двоичные данные
browser/themes/linux/tabbrowser/tab-background-start.png Normal file

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

После

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

Двоичные данные
browser/themes/linux/tabbrowser/tab-stroke-end.png Normal file

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

После

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

Двоичные данные
browser/themes/linux/tabbrowser/tab-stroke-start.png Normal file

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

После

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

Двоичные данные
browser/themes/osx/Toolbar-background-noise.png Normal file

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

После

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

Двоичные данные
browser/themes/osx/appmenu.png Normal file

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

После

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

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

@ -6,6 +6,8 @@
%include shared.inc
%filter substitution
%define fgTabTexture linear-gradient(hsla(0,0%,100%,0.6), hsla(0,0%,100%,0.6) 0px, hsl(0,0%,99%) 1px, hsl(0,0%,92%))
%define fgTabBackgroundMiddle linear-gradient(transparent, transparent)
%define forwardTransitionLength 150ms
%define conditionalForwardWithUrlbar window:not([chromehidden~=toolbar]) #navigator-toolbox[iconsize=large][mode=icons] > :-moz-any(#nav-bar[currentset*="unified-back-forward-button,urlbar-container"],#nav-bar:not([currentset])) > #unified-back-forward-button
%define conditionalForwardWithUrlbarWidth 27
@ -38,8 +40,7 @@
background-color: #eeeeee;
}
#titlebar-buttonbox-container,
#main-window:not([drawintitlebar=true]) > #titlebar {
#titlebar-buttonbox-container {
display: none;
}
@ -47,6 +48,10 @@
height: 22px;
}
#main-window:not(:-moz-lwtheme):not([privatebrowsingmode=temporary]) > #titlebar {
-moz-appearance: -moz-window-titlebar;
}
#main-window[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] {
border-top: 1px solid rgba(0,0,0,0.65);
}
@ -62,6 +67,17 @@ toolbarseparator {
min-height: 22px;
}
toolbox[tabsontop=true] > toolbar:not(#TabsToolbar):not(#nav-bar):not(#toolbar-menubar),
toolbox[tabsontop=false] > toolbar:not(#nav-bar) {
margin-top: -2px; /* overlay the bottom border of the toolbar above us */
padding-top: 1px !important;
}
toolbox[tabsontop=true] > toolbar:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
-moz-appearance: none;
background: url(chrome://browser/skin/Toolbar-background-noise.png) hsl(0,0%,83%);
}
/* We need more height when toolbar buttons show both icon and text. */
toolbar[mode="full"] toolbarseparator {
min-height: 36px;
@ -73,10 +89,9 @@ toolbar[mode="full"] toolbarseparator {
#PersonalToolbar {
-moz-appearance: none;
margin-top: -2px; /* overlay the bottom border of the toolbar above us */
padding-top: 1px !important;
background-color: -moz-mac-chrome-active;
border-bottom: 1px solid rgba(0, 0, 0, 0.57);
border-bottom: 2px solid;
-moz-border-bottom-colors: hsla(0,0%,0%,.15) hsla(0,0%,100%,.15);
}
#nav-bar[tabsontop=true],
@ -85,9 +100,11 @@ toolbar[mode="full"] toolbarseparator {
-moz-appearance: none;
margin-top: 0; /* don't overlay the bottom border of the tabs toolbar */
padding-top: 4px !important;
border-bottom: 1px solid rgba(0, 0, 0, 0.57);
background-color: -moz-mac-chrome-active;
background-image: linear-gradient(rgba(255,255,255,.43), rgba(255,255,255,0)) !important; /* override lwtheme style */
border-bottom: 2px solid;
-moz-border-bottom-colors: hsla(0,0%,0%,.15) hsla(0,0%,100%,.15);
background: url(chrome://browser/skin/Toolbar-background-noise.png),
linear-gradient(hsl(0,0%,93%), hsl(0,0%,83%)); !important; /* override lwtheme style */
background-clip: border-box;
background-origin: border-box !important;
}
@ -104,7 +121,6 @@ toolbar[mode="full"] toolbarseparator {
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + toolbar:not(:-moz-lwtheme):-moz-window-inactive,
#nav-bar[tabsontop=true][collapsed=true]:not([customizing]) + #customToolbars + #PersonalToolbar:not(:-moz-lwtheme):-moz-window-inactive {
background-color: -moz-mac-chrome-inactive;
border-bottom-color: rgba(0, 0, 0, 0.32);
}
/* ----- BOOKMARK TOOLBAR ----- */
@ -2165,6 +2181,8 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
margin: 0;
}
%include ../shared/tabs.inc.css
.tab-throbber,
.tab-icon-image {
width: 16px;
@ -2196,7 +2214,11 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
}
.tabbrowser-tab:not(:hover) > .tab-stack > .tab-content > .tab-icon-image:not([selected="true"]) {
opacity: .8;
opacity: .9;
}
.tab-label:not([selected="true"]) {
opacity: .7;
}
.tabbrowser-tab:not([pinned]):not([fadein]) {
@ -2205,57 +2227,27 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
opacity 50ms ease-out 100ms /* hide the tab for the last 100ms of the max-width transition */;
}
.tab-stack {
/* ensure stable tab height with and without toolbarbuttons on the tab bar */
height: 26px;
}
.tabbrowser-tab,
.tabs-newtab-button {
-moz-appearance: none;
font: message-box;
font-weight: bold;
text-shadow: @loweredShadow@;
margin: 0;
padding: 0;
border: none;
text-align: center;
-moz-box-align: stretch;
}
%define TABSONTOP_TAB #tabbrowser-tabs[tabsontop="true"] > .tabbrowser-tab
%define TABSONBOTTOM_TAB #tabbrowser-tabs[tabsontop="false"] > .tabbrowser-tab
%define TABSONTOP_TAB_STACK #tabbrowser-tabs[tabsontop="true"] > .tabbrowser-tab > .tab-stack
%define TABSONBOTTOM_TAB_STACK #tabbrowser-tabs[tabsontop="false"] > .tabbrowser-tab > .tab-stack
.tabbrowser-tab {
color: #333;
}
%define TABSONTOP_NEWTAB_BUTTON #tabbrowser-tabs[tabsontop="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button
%define TABSONBOTTOM_NEWTAB_BUTTON #tabbrowser-tabs[tabsontop="false"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button
@TABSONTOP_TAB_STACK@ > .tab-background {
margin-top: 3px;
}
@TABSONBOTTOM_TAB_STACK@ > .tab-background {
margin-bottom: 3px;
}
@TABSONTOP_TAB_STACK@ > .tab-background:not([selected="true"]):not(:-moz-lwtheme) {
margin-bottom: 2px;
}
@TABSONBOTTOM_TAB_STACK@ > .tab-background:not([selected="true"]) {
margin-top: 2px;
}
.tab-background,
.tab-content,
.tabs-newtab-button > .toolbarbutton-icon {
-moz-margin-start: -5px;
-moz-margin-end: -4px;
pointer-events: none;
}
.tab-close-button {
pointer-events: auto;
.tab-background-start[selected=true]::before,
.tab-background-end[selected=true]::before {
/* The fill is in the image of ::after on OS X */
background: none;
}
.tabbrowser-tabs[closebuttons="hidden"] > * > * > * > .tab-close-button:not([pinned]) {
@ -2263,178 +2255,16 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
visibility: hidden;
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox {
-moz-padding-start: 5px;
-moz-padding-end: 4px;
}
.tab-content,
.tabs-newtab-button > .toolbarbutton-icon {
-moz-box-align: center;
border: solid transparent;
border-width: 0 11px;
}
.tab-background-start,
.tab-background-end {
width: 12px;
height: 21px;
}
.tab-background-middle {
-moz-box-flex: 1;
}
@TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-start:-moz-locale-dir(ltr),
@TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-end:-moz-locale-dir(rtl) {
clip-path: url(chrome://browser/content/browser.xul#osx-tab-ontop-left-curve-clip-path);
}
@TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-end:-moz-locale-dir(ltr),
@TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-start:-moz-locale-dir(rtl) {
clip-path: url(chrome://browser/content/browser.xul#osx-tab-ontop-right-curve-clip-path);
}
@TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-start:-moz-locale-dir(ltr),
@TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-end:-moz-locale-dir(rtl) {
clip-path: url(chrome://browser/content/browser.xul#osx-tab-onbottom-left-curve-clip-path);
}
@TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-end:-moz-locale-dir(ltr),
@TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-start:-moz-locale-dir(rtl) {
clip-path: url(chrome://browser/content/browser.xul#osx-tab-onbottom-right-curve-clip-path);
}
.tab-background-start[selected="true"]:not(:-moz-lwtheme),
.tab-background-middle[selected="true"]:not(:-moz-lwtheme),
.tab-background-end[selected="true"]:not(:-moz-lwtheme) {
background-color: -moz-mac-chrome-active;
}
.tab-background-start[selected="true"]:not(:-moz-lwtheme):-moz-window-inactive,
.tab-background-middle[selected="true"]:not(:-moz-lwtheme):-moz-window-inactive,
.tab-background-end[selected="true"]:not(:-moz-lwtheme):-moz-window-inactive {
background-color: -moz-mac-chrome-inactive;
}
.tab-background-start[pinned][titlechanged]:not([selected="true"]),
.tab-background-end[pinned][titlechanged]:not([selected="true"]) {
background-image: linear-gradient(rgba(148,205,253,.2), rgba(148,205,253,.2)) !important;
}
@TABSONBOTTOM_TAB_STACK@ > .tab-background > .tab-background-middle[pinned][titlechanged]:not([selected="true"]) {
background-image: radial-gradient(circle farthest-corner at 50% 99%, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%);
}
@TABSONTOP_TAB_STACK@ > .tab-background > .tab-background-middle[pinned][titlechanged]:not([selected="true"]) {
background-image: radial-gradient(circle farthest-corner at 50% 2px, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%);
}
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-start:-moz-lwtheme-brighttext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-middle:-moz-lwtheme-brighttext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-end:-moz-lwtheme-brighttext:not([selected="true"]) {
background-image: linear-gradient(hsla(0,0%,40%,.6), hsla(0,0%,30%,.6) 50%);
}
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-start:-moz-lwtheme-darktext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-middle:-moz-lwtheme-darktext:not([selected="true"]),
.tabbrowser-tab > .tab-stack > .tab-background > .tab-background-end:-moz-lwtheme-darktext:not([selected="true"]) {
background-image: linear-gradient(hsla(0,0%,60%,.5), hsla(0,0%,45%,.5) 50%);
}
@TABSONTOP_TAB_STACK@ > .tab-content,
@TABSONTOP_NEWTAB_BUTTON@ > .toolbarbutton-icon {
border-image: url(chrome://browser/skin/tabbrowser/tab-top-normal-active.png) 0 11 fill repeat stretch;
}
@TABSONTOP_TAB@:hover > .tab-stack > .tab-content:not([selected="true"]),
@TABSONTOP_NEWTAB_BUTTON@:hover > .toolbarbutton-icon {
border-image: url(chrome://browser/skin/tabbrowser/tab-top-hover-active.png) 0 11 fill repeat stretch;
}
@TABSONTOP_TAB_STACK@ > .tab-content[selected="true"] {
border-image: url(chrome://browser/skin/tabbrowser/tab-top-selected-active.png) 0 11 fill repeat stretch;
}
@TABSONBOTTOM_TAB_STACK@ > .tab-content,
@TABSONBOTTOM_NEWTAB_BUTTON@ > .toolbarbutton-icon {
border-image: url(chrome://browser/skin/tabbrowser/tab-bottom-normal-active.png) 0 11 fill repeat stretch;
}
@media (min-resolution: 2dppx) {
@TABSONTOP_TAB_STACK@ > .tab-content,
@TABSONTOP_NEWTAB_BUTTON@ > .toolbarbutton-icon {
border-image: url(chrome://browser/skin/tabbrowser/tab-top-normal-active@2x.png) 0 22 fill repeat stretch;
}
@TABSONTOP_TAB@:hover > .tab-stack > .tab-content:not([selected="true"]),
@TABSONTOP_NEWTAB_BUTTON@:hover > .toolbarbutton-icon {
border-image: url(chrome://browser/skin/tabbrowser/tab-top-hover-active@2x.png) 0 22 fill repeat stretch;
}
@TABSONTOP_TAB_STACK@ > .tab-content[selected="true"] {
border-image: url(chrome://browser/skin/tabbrowser/tab-top-selected-active@2x.png) 0 22 fill repeat stretch;
}
}
@TABSONBOTTOM_TAB@:hover > .tab-stack > .tab-content:not([selected="true"]),
@TABSONBOTTOM_NEWTAB_BUTTON@:hover > .toolbarbutton-icon {
border-image: url(chrome://browser/skin/tabbrowser/tab-bottom-hover-active.png) 0 11 fill repeat stretch;
}
@TABSONBOTTOM_TAB_STACK@ > .tab-content[selected="true"] {
border-image: url(chrome://browser/skin/tabbrowser/tab-bottom-selected-active.png) 0 11 fill repeat stretch;
}
/* preloading hack */
#TabsToolbar::after {
content: '';
display: block;
background-image:
url(chrome://browser/skin/tabbrowser/tab-top-normal-active.png),
url(chrome://browser/skin/tabbrowser/tab-top-hover-active.png),
url(chrome://browser/skin/tabbrowser/tab-top-selected-active.png),
url(chrome://browser/skin/tabbrowser/tab-bottom-normal-active.png),
url(chrome://browser/skin/tabbrowser/tab-bottom-hover-active.png),
url(chrome://browser/skin/tabbrowser/tab-bottom-selected-active.png),
url(chrome://browser/skin/tabbrowser/tabbar-top-bg-active.png),
url(chrome://browser/skin/tabbrowser/tabbar-top-bg-inactive.png),
url(chrome://browser/skin/tabbrowser/tabbar-bottom-bg-active.png),
url(chrome://browser/skin/tabbrowser/tabbar-bottom-bg-inactive.png);
}
@media (min-resolution: 2dppx) {
#TabsToolbar::after {
content: '';
display: block;
background-image:
url(chrome://browser/skin/tabbrowser/tab-top-normal-active@2x.png),
url(chrome://browser/skin/tabbrowser/tab-top-hover-active@2x.png),
url(chrome://browser/skin/tabbrowser/tab-top-selected-active@2x.png),
url(chrome://browser/skin/tabbrowser/tab-bottom-normal-active.png),
url(chrome://browser/skin/tabbrowser/tab-bottom-hover-active.png),
url(chrome://browser/skin/tabbrowser/tab-bottom-selected-active.png),
url(chrome://browser/skin/tabbrowser/tabbar-top-bg-active.png),
url(chrome://browser/skin/tabbrowser/tabbar-top-bg-inactive.png),
url(chrome://browser/skin/tabbrowser/tabbar-bottom-bg-active.png),
url(chrome://browser/skin/tabbrowser/tabbar-bottom-bg-inactive.png);
}
}
.tabbrowser-tab:focus > .tab-stack {
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
box-shadow: @focusRingShadow@;
}
.tabbrowser-tab:not([selected="true"]):not(:hover):not(:-moz-lwtheme) {
color: #222;
}
.tabbrowser-tab[selected="true"] {
color: #000;
z-index: 1;
position: relative;
}
.tabbrowser-tab:-moz-lwtheme {
color: inherit;
text-shadow: inherit;
@ -2449,13 +2279,12 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
content: '';
display: block;
-moz-appearance: toolbar;
height: 25px;
margin-bottom: -25px;
height: calc(@tabHeight@ + 1px);
margin-bottom: calc(-1px - @tabHeight@);
}
#TabsToolbar {
-moz-appearance: none;
height: 26px;
background-repeat: repeat-x;
}
@ -2464,59 +2293,34 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
padding-top: 2px;
}
/* For tabs-on-top, only fill the bottom 2px with the chrome background
* color, so that the borders in tabbar-top-bg-*.png can mix with it.
* In the top 24px the unified toolbar (from the ::before above) will show.
/*
* Draw the bottom border of the tabstrip above ::before
*/
#TabsToolbar[tabsontop="true"]:not(:-moz-lwtheme) {
padding-bottom: 2px;
background: url(chrome://browser/skin/tabbrowser/tabbar-top-bg-active.png),
linear-gradient(to top, -moz-mac-chrome-active 2px, transparent 2px);
}
#TabsToolbar[tabsontop="true"]:not(:-moz-lwtheme):-moz-window-inactive {
background: url(chrome://browser/skin/tabbrowser/tabbar-top-bg-inactive.png),
linear-gradient(to top, -moz-mac-chrome-inactive 2px, transparent 2px);
background: linear-gradient(to top, hsla(0,0%,0%,.3), hsla(0,0%,0%,.3) 1px, transparent 1px);
}
/* In tabs-on-bottom mode, fill the whole toolbar with the chrome
* background color.
*/
#TabsToolbar[tabsontop="false"]:not(:-moz-lwtheme) {
background: url(chrome://browser/skin/tabbrowser/tabbar-bottom-bg-active.png) -moz-mac-chrome-active;
background: -moz-mac-chrome-active;
}
#TabsToolbar[tabsontop="false"]:not(:-moz-lwtheme):-moz-window-inactive {
background: url(chrome://browser/skin/tabbrowser/tabbar-bottom-bg-inactive.png) -moz-mac-chrome-inactive;
background: -moz-mac-chrome-inactive;
}
#tabbrowser-tabs {
-moz-box-align: stretch;
height: 26px;
}
#tabbrowser-tabs[tabsontop="true"] > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox:not(:-moz-lwtheme) {
margin-bottom: -2px;
}
#tabbrowser-tabs[tabsontop="false"] > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox {
margin-top: -2px;
}
@TABSONTOP_NEWTAB_BUTTON@ > .toolbarbutton-icon {
padding: 4px 0 2px;
}
@TABSONTOP_TAB_STACK@ > .tab-content {
padding-top: 2px;
padding: 6px 0 4px;
}
@TABSONBOTTOM_NEWTAB_BUTTON@ > .toolbarbutton-icon {
padding: 2px 0 4px;
}
@TABSONBOTTOM_TAB_STACK@ > .tab-content {
padding-bottom: 2px;
padding: 4px 0 6px;
}
/**
@ -3794,6 +3598,12 @@ chatbox {
border-top-right-radius: @toolbarbuttonCornerRadius@;
}
/* Customization mode */
%include ../shared/customization.inc.css
/* End customization mode */
panel[type="arrow"][popupid="click-to-play-plugins"] > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="top"],
panel[type="arrow"][popupid="click-to-play-plugins"] > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="bottom"] {
list-style-image: url("chrome://global/skin/arrow/panelarrow-light-vertical.png");

Двоичные данные
browser/themes/osx/customization/customization-mode-background.jpg Normal file

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

После

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

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

@ -18,8 +18,10 @@ browser.jar:
#endif
skin/classic/browser/actionicon-tab.png
skin/classic/browser/actionicon-tab@2x.png
skin/classic/browser/appmenu.png
* skin/classic/browser/browser.css (browser.css)
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/customization/customization-mode-background.jpg (customization/customization-mode-background.jpg)
* skin/classic/browser/engineManager.css (engineManager.css)
skin/classic/browser/Geolocation-16.png
skin/classic/browser/Geolocation-16@2x.png
@ -58,6 +60,7 @@ browser.jar:
skin/classic/browser/page-livemarks.png
skin/classic/browser/page-livemarks@2x.png
skin/classic/browser/pageInfo.css
* skin/classic/browser/panelUIOverlay.css
skin/classic/browser/pointerLock-16.png
skin/classic/browser/pointerLock-16@2x.png
skin/classic/browser/pointerLock-64.png
@ -176,23 +179,20 @@ browser.jar:
skin/classic/browser/tabbrowser/connecting@2x.png (tabbrowser/connecting@2x.png)
skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/browser/tabbrowser/loading@2x.png (tabbrowser/loading@2x.png)
skin/classic/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
skin/classic/browser/tabbrowser/tab-arrow-left@2x.png (tabbrowser/tab-arrow-left@2x.png)
skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png)
skin/classic/browser/tabbrowser/tab-arrow-right@2x.png (tabbrowser/tab-arrow-right@2x.png)
skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/browser/tabbrowser/tab-background-middle.png (tabbrowser/tab-background-middle.png)
skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png)
skin/classic/browser/tabbrowser/tab-stroke-end.png (tabbrowser/tab-stroke-end.png)
skin/classic/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png)
skin/classic/browser/tabbrowser/tabbar-bottom-bg-active.png (tabbrowser/tabbar-bottom-bg-active.png)
skin/classic/browser/tabbrowser/tabbar-bottom-bg-inactive.png (tabbrowser/tabbar-bottom-bg-inactive.png)
skin/classic/browser/tabbrowser/tab-bottom-normal-active.png (tabbrowser/tab-bottom-normal-active.png)
skin/classic/browser/tabbrowser/tab-bottom-hover-active.png (tabbrowser/tab-bottom-hover-active.png)
skin/classic/browser/tabbrowser/tab-bottom-selected-active.png (tabbrowser/tab-bottom-selected-active.png)
skin/classic/browser/tabbrowser/tabbar-top-bg-active.png (tabbrowser/tabbar-top-bg-active.png)
skin/classic/browser/tabbrowser/tabbar-top-bg-inactive.png (tabbrowser/tabbar-top-bg-inactive.png)
skin/classic/browser/tabbrowser/tab-top-normal-active.png (tabbrowser/tab-top-normal-active.png)
skin/classic/browser/tabbrowser/tab-top-normal-active@2x.png (tabbrowser/tab-top-normal-active@2x.png)
skin/classic/browser/tabbrowser/tab-top-hover-active.png (tabbrowser/tab-top-hover-active.png)
skin/classic/browser/tabbrowser/tab-top-hover-active@2x.png (tabbrowser/tab-top-hover-active@2x.png)
skin/classic/browser/tabbrowser/tab-top-selected-active.png (tabbrowser/tab-top-selected-active.png)
skin/classic/browser/tabbrowser/tab-top-selected-active@2x.png (tabbrowser/tab-top-selected-active@2x.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/tabbrowser/tabDragIndicator@2x.png (tabbrowser/tabDragIndicator.png)
@ -313,6 +313,7 @@ browser.jar:
skin/classic/browser/keyhole-circle@2x.png (keyhole-circle-lion@2x.png)
skin/classic/browser/lion/Toolbar.png (Toolbar-lion.png)
skin/classic/browser/Toolbar@2x.png (Toolbar-lion@2x.png)
skin/classic/browser/Toolbar-background-noise.png (Toolbar-background-noise.png)
skin/classic/browser/lion/toolbarbutton-dropmarker.png (toolbarbutton-dropmarker-lion.png)
skin/classic/browser/toolbarbutton-dropmarker@2x.png (toolbarbutton-dropmarker-lion@2x.png)
skin/classic/browser/lion/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon-lion.png)

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

@ -0,0 +1,46 @@
/* 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/. */
%filter substitution
%define menuPanelWidth 26em
%include ../shared/panelUIOverlay.inc.css
.PanelUI-pageControls toolbarbutton {
list-style-image: url("chrome://browser/skin/Toolbar.png");
}
#PanelUI-cut-btn {
-moz-image-region: rect(0, 260px, 20px, 240px);
}
#PanelUI-copy-btn {
-moz-image-region: rect(0, 280px, 20px, 260px);
}
#PanelUI-paste-btn {
-moz-image-region: rect(0, 300px, 20px, 280px);
}
#PanelUI-zoomOut-btn {
-moz-image-region: rect(0, 400px, 20px, 380px);
padding-left: 12px;
padding-right: 12px;
}
#PanelUI-zoomIn-btn {
-moz-image-region: rect(0, 420px, 20px, 400px);
padding-left: 12px;
padding-right: 12px;
}
.PanelUI-editControls #PanelUI-copy-btn,
.PanelUI-zoomControls #PanelUI-zoomReset-btn {
border-left: none;
border-right: none;
border-radius: 0;
}
#PanelUI-zoomIn-btn .toolbarbutton-text,
#PanelUI-zoomOut-btn .toolbarbutton-text,
#PanelUI-zoomReset-btn .toolbarbutton-icon {
display: none;
}

Двоичные данные
browser/themes/osx/tabbrowser/tab-active-middle.png Normal file

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

После

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

Двоичные данные
browser/themes/osx/tabbrowser/tab-background-end.png Normal file

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

После

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

Двоичные данные
browser/themes/osx/tabbrowser/tab-background-middle.png Normal file

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

После

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

Двоичные данные
browser/themes/osx/tabbrowser/tab-background-start.png Normal file

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

После

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

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

До

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

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

До

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

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

До

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

Двоичные данные
browser/themes/osx/tabbrowser/tab-stroke-end.png Executable file

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

После

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

Двоичные данные
browser/themes/osx/tabbrowser/tab-stroke-start.png Executable file

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

После

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

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

До

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

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

До

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

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

До

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

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

До

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

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

До

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

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

До

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

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

@ -0,0 +1,86 @@
/* 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/. */
/* Customization mode */
#main-window[customizing] {
background-image: url("chrome://browser/skin/customization/customization-mode-background.jpg");
background-size: 100% 100%;
background-repeat: no-repeat;
}
#main-window[customizing] #tab-view-deck {
transition-property: padding;
transition-duration: 300ms;
transition-timing-function: ease-out;
padding: 8em;
}
#main-window:not([customizing]) #tab-view-deck {
transition-property: padding;
transition-duration: 200ms;
transition-timing-function: ease-out;
padding: 0;
}
#main-window[customizing] .tabbrowser-tab:not([selected]),
#main-window[customizing] .tabs-newtab-button {
opacity: 0.4;
}
#main-window[customizing] .customization-target,
#customization-panelHolder > #PanelUI-mainView {
box-shadow: inset 0 0 3px hsl(204,100%,40%);
border-radius: 2px;
}
#main-window[customizing] .customization-target {
min-width: 100px;
padding-left: 10px;
padding-right: 10px;
}
#customization-panelWrapper {
padding: 0px 8px;
}
toolbarpaletteitem {
cursor: -moz-grab;
transition: transform, background-color, border-color, box-shadow;
transition-duration: 50ms, 10ms, 10ms, 10ms;
transition-timing-function: ease-in-out, linear, linear, linear;
}
toolbarpaletteitem[mousedown] {
box-shadow: inset 0 0 3px hsl(204,100%,40%);
cursor: -moz-grabbing;
opacity: 0.8;
transform: scale(1.1);
}
#customization-palette {
display: block;
overflow: auto;
min-height: 3em;
}
#customization-palette > toolbarpaletteitem {
width: 110px;
height: 94px;
overflow: hidden;
display: inline-block;
}
#customization-palette .toolbarpaletteitem-box {
-moz-box-pack: center;
-moz-box-flex: 1;
width: 110px;
max-width: 110px;
}
#customization-palette > toolbarpaletteitem > label {
text-align: center;
margin-left: 0;
margin-right: 0;
}

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

@ -0,0 +1,228 @@
/* 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/. */
#PanelUI-contents[type="list"] > toolbarbutton {
-moz-binding: url("chrome://browser/content/panelUI.xml#toolbarbutton");
}
#app-extension-point-end > #PanelUI-menu-button {
padding: 2px 5px;
}
#app-extension-point-end > #PanelUI-menu-button .toolbarbutton-text {
display: none;
}
#app-extension-point-end > #PanelUI-menu-button .toolbarbutton-icon {
margin: 0;
}
#PanelUI-popup > arrowscrollbox > autorepeatbutton {
display: none;
}
#PanelUI-popup > arrowscrollbox > scrollbox {
overflow: visible;
}
#PanelUI-popup > .panel-arrowcontainer > .panel-arrowcontent {
padding: 0;
}
#PanelUI-menu-button > .toolbarbutton-icon {
list-style-image: url("chrome://browser/skin/appmenu.png");
}
#PanelUI-menu-button {
list-style-image: none;
}
#PanelUI-mainView .toolbarbutton-text {
display: -moz-box;
font-size: 10px;
}
#PanelUI-contents {
max-width: @menuPanelWidth@;
padding: 0 1em;
}
#PanelUI-container {
overflow: hidden;
}
#PanelUI-popup[panelopen="true"] > #PanelUI-container,
#PanelUI-mainView-spring {
transition: height 150ms;
}
#PanelUI-popup[panelopen="true"] > #PanelUI-container > #PanelUI-viewStack > #PanelUI-mainView {
transition: transform 150ms;
}
#PanelUI-viewStack[view="main"] > #PanelUI-clickCapturer {
pointer-events: none;
}
#PanelUI-viewStack {
position: relative;
}
#PanelUI-viewStack,
#PanelUI-container {
min-width: @menuPanelWidth@;
}
#PanelUI-mainView-spring {
height: 0;
}
#PanelUI-subViews {
-moz-stack-sizing: ignore;
background-image: linear-gradient(to bottom, white 1px, rgba(255, 255, 255, 0) 15px);
background-color: -moz-dialog;
box-shadow: -1px 0px 0px rgba(0, 0, 0, 0.2), -1px 0px 2px rgba(0, 0, 0, 0.1), 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
margin-left: 38px;
transform: translateX(@menuPanelWidth@);
transition: transform 150ms;
}
#PanelUI-subViews > .PanelUI-subView:not([current]) {
display: none;
}
#PanelUI-viewStack[view="subview"] > #PanelUI-subViews {
transform: translateX(0);
}
#PanelUI-contents[type="list"] > toolbarbutton {
-moz-box-orient: horizontal;
}
#PanelUI-contents[type="list"] toolbarbutton .toolbarbutton-text,
#PanelUI-subViews toolbarbutton .toolbarbutton-text {
text-align: start;
-moz-padding-start: 8px;
font-size: 12px;
}
#PanelUI-contents[type="list"] toolbarbutton .toolbarbutton-acceltext {
font-size: 10px;
color: GrayText;
margin-left: 0;
margin-right: 0;
}
#PanelUI-contents[type="list"] toolbarbutton .toolbarbutton-icon {
min-width: 24px;
max-width: 24px;
min-height: 24px;
max-height: 24px;
}
#PanelUI-contents[type="grid"] {
display: block;
}
#PanelUI-contents[type="grid"] toolbarbutton {
-moz-box-orient: vertical;
min-width: 72px;
max-width: 72px;
min-height: 72px;
max-height: 72px;
}
#PanelUI-contents[type="grid"] toolbarbutton .toolbarbutton-icon {
min-width: 32px;
max-width: 32px;
min-height: 32px;
max-height: 32px;
margin: 5px;
}
.PanelUI-pageControls {
padding: 12px 20px;
}
.PanelUI-editControls,
.PanelUI-zoomControls {
padding: 6px 0;
}
.PanelUI-editControls #PanelUI-copy-btn,
.PanelUI-zoomControls #PanelUI-zoomReset-btn {
border-left: none;
border-right: none;
border-radius: 0;
}
#PanelUI-zoomIn-btn .toolbarbutton-text,
#PanelUI-zoomOut-btn .toolbarbutton-text,
#PanelUI-zoomReset-btn .toolbarbutton-icon {
display: none;
}
.PanelUI-footer {
padding: 9px 12px;
background-color: rgba(0, 0, 0, 0.05);
border-top: 1px solid rgba(0,0,0,.1);
}
.PanelUI-footer toolbarbutton > .toolbarbutton-icon {
display: none;
}
#PanelUI-help-btn {
-moz-appearance: none;
border: none;
box-shadow: none;
background: transparent;
text-decoration: underline;
cursor: pointer;
}
#customization-palette .toolbarbutton-text {
display: none;
}
#PanelUI-subViews toolbarbutton,
#PanelUI-mainView toolbarbutton {
-moz-appearance: none;
padding: 2px 6px;
background: hsla(210,32%,93%,0) padding-box;
border-radius: 2px;
border: 1px solid;
border-color: hsla(210,54%,20%,0) hsla(210,54%,20%,0) hsla(210,54%,20%,0);
box-shadow: 0 1px hsla(0,0%,100%,0) inset,
0 1px hsla(210,54%,20%,0),
0 0 2px hsla(210,54%,20%,0);
transition-property: background-color, border-color, box-shadow;
transition-duration: 150ms;
}
#PanelUI-subViews toolbarbutton:not([disabled]):not([checked]):not([open]):not(:active):hover,
#PanelUI-mainView toolbarbutton:not([disabled]):not([checked]):not([open]):not(:active):hover,
#PanelUI-mainView .PanelUI-pageControls toolbarbutton,
#PanelUI-mainView #PanelUI-customize-btn {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.2) hsla(210,54%,20%,.25);
box-shadow: 0 1px hsla(0,0%,100%,.3) inset,
0 1px hsla(210,54%,20%,.03),
0 0 2px hsla(210,54%,20%,.1);
}
#PanelUI-subViews toolbarbutton:not([disabled]):-moz-any([open],[checked],:hover:active),
#PanelUI-mainView toolbarbutton:not([disabled]):-moz-any([open],[checked],:hover:active) {
background-image: -moz-linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
background-color: hsla(210,54%,20%,.15);
border-color: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4);
box-shadow: 0 1px 1px hsla(210,54%,20%,.1) inset,
0 0 1px hsla(210,54%,20%,.2) inset,
0 1px 0 hsla(210,54%,20%,0),
0 0 2px hsla(210,54%,20%,0);
text-shadow: none;
transition: none;
}
#PanelUI-historyItems > toolbarbutton {
list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
}

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

@ -0,0 +1,209 @@
%if 0
/* 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/. */
%endif
%define tabHeight 30px
%define tabCurveWidth 30px
%define tabCurveHalfWidth 15px
/* image preloading hack */
#TabsToolbar::after {
content: '';
display: block;
background-image:
url(chrome://browser/skin/tabbrowser/tab-background-end.png),
url(chrome://browser/skin/tabbrowser/tab-background-middle.png),
url(chrome://browser/skin/tabbrowser/tab-background-start.png);
}
.tabbrowser-tab,
.tabs-newtab-button {
-moz-appearance: none;
background-color: transparent;
border-radius: 0;
border-width: 0;
margin: 0;
padding: 0;
}
/* The selected tab should appear above adjacent tabs and .tabs-newtab-button */
.tabbrowser-tab[selected=true] {
position: relative;
z-index: 1;
}
.tab-background-middle {
-moz-box-flex: 1;
background-clip: padding-box;
border-left: @tabCurveHalfWidth@ solid transparent;
border-right: @tabCurveHalfWidth@ solid transparent;
margin: 0 -@tabCurveHalfWidth@;
}
.tab-content {
-moz-padding-end: 10px;
-moz-padding-start: 10px;
}
.tab-background,
.tabs-newtab-button {
/* overlap the tab curves */
-moz-margin-end: -@tabCurveHalfWidth@;
-moz-margin-start: -@tabCurveHalfWidth@;
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox {
-moz-padding-end: @tabCurveHalfWidth@;
-moz-padding-start: @tabCurveHalfWidth@;
}
.tab-background-start[selected=true]::after,
.tab-background-start[selected=true]::before,
.tab-background-start,
.tab-background-end,
.tab-background-end[selected=true]::after,
.tab-background-end[selected=true]::before {
min-height: @tabHeight@;
width: @tabCurveWidth@;
}
/* Selected tab */
/*
Tab background pseudo-elements which are positioned above .tab-background-start/end:
- ::before - provides the fill of the tab curve and is clipped to the tab shape. This is where
pointer events go for the curve.
- ::after - provides the border/stroke of the tab curve and is overlayed above ::before. Pointer
events go through to ::before to get the proper shape.
*/
.tab-background-start[selected=true]::after,
.tab-background-end[selected=true]::after {
/* position ::after on top of its parent */
-moz-margin-start: -@tabCurveWidth@;
content: "";
display: -moz-box;
}
.tab-background-start[selected=true]::before,
.tab-background-end[selected=true]::before {
/* all ::before pseudo elements */
content: "";
display: -moz-box;
}
.tab-background-start[selected=true]:-moz-locale-dir(ltr)::before,
.tab-background-end[selected=true]:-moz-locale-dir(rtl)::before {
clip-path: url(chrome://browser/content/browser.xul#tab-curve-clip-path-start);
}
.tab-background-end[selected=true]:-moz-locale-dir(ltr)::before,
.tab-background-start[selected=true]:-moz-locale-dir(rtl)::before {
clip-path: url(chrome://browser/content/browser.xul#tab-curve-clip-path-end);
}
.tab-background-start[selected=true]:not(:-moz-lwtheme)::after,
.tab-background-end[selected=true]:not(:-moz-lwtheme)::after {
background-repeat: no-repeat;
}
.tab-background-start[selected=true]:not(:-moz-lwtheme):-moz-locale-dir(ltr)::after,
.tab-background-end[selected=true]:not(:-moz-lwtheme):-moz-locale-dir(rtl)::after {
background-image: url(chrome://browser/skin/tabbrowser/tab-stroke-start.png);
}
.tab-background-end[selected=true]:not(:-moz-lwtheme):-moz-locale-dir(ltr)::after,
.tab-background-start[selected=true]:not(:-moz-lwtheme):-moz-locale-dir(rtl)::after {
background-image: url(chrome://browser/skin/tabbrowser/tab-stroke-end.png);
}
.tab-background-start[selected=true]::before,
.tab-background-end[selected=true]::before {
background-color: -moz-dialog;
background-image: @fgTabTexture@;
background-repeat: no-repeat;
}
.tab-background-middle[selected=true] {
background-color: transparent;
background-image: url(chrome://browser/skin/tabbrowser/tab-active-middle.png),
@fgTabBackgroundMiddle@;
background-repeat: repeat-x;
}
/* Same as above but without border or -moz-dialog background */
.tab-background-start[selected=true]:-moz-lwtheme::before,
.tab-background-end[selected=true]:-moz-lwtheme::before,
.tab-background-middle[selected=true]:-moz-lwtheme {
background-color: transparent;
background-image: @fgTabTexture@;
background-position: left 0 top 2px;
}
/* End selected tab */
/* new tab button border and gradient on hover */
.tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]),
.tabs-newtab-button:hover {
background-image: url(chrome://browser/skin/tabbrowser/tab-background-start.png),
url(chrome://browser/skin/tabbrowser/tab-background-middle.png),
url(chrome://browser/skin/tabbrowser/tab-background-end.png);
background-position: left bottom, @tabCurveWidth@ bottom, right bottom;
background-repeat: no-repeat;
background-size: @tabCurveWidth@ 100%, calc(100% - (2 * @tabCurveWidth@)) 100%, @tabCurveWidth@ 100%;
}
/* Tab pointer-events */
.tabbrowser-tab {
pointer-events: none;
}
/* Allow pointer-events on ::before of the ends of selected tabs
since they are clipped to the curve shape. */
.tab-background-start[selected=true]::before,
.tab-background-end[selected=true]::before,
.tab-background-middle,
.tabs-newtab-button,
.tab-close-button {
pointer-events: auto;
}
/* Pinned tabs */
/* pinned tabs need position: fixed for separator when overflowing */
#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::before {
position: fixed;
}
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) > .tab-stack > .tab-content {
background-image: radial-gradient(farthest-corner at center bottom, rgb(255,255,255) 3%, rgba(186,221,251,0.75) 20%, rgba(127,179,255,0.25) 40%, rgba(127,179,255,0) 70%);
background-position: center bottom 1px;
background-repeat: no-repeat;
background-size: 85% 100%;
}
/* Background tab separators (1px wide).
Also show separators beside the selected tab when dragging it. */
#tabbrowser-tabs[movingtab] > .tabbrowser-tab[beforeselected]:not([last-visible-tab])::after,
.tabbrowser-tab:not([selected]):not([afterselected-visible]):not([afterhovered]):not([first-visible-tab]):not(:hover)::before,
#tabbrowser-tabs:not([overflow]) > .tabbrowser-tab[last-visible-tab]:not([selected]):not([beforehovered]):not(:hover)::after {
-moz-margin-start: -1px;
background-image: linear-gradient(rgba(10,31,51,0), rgba(10,31,51,0.3));
background-position: left bottom;
background-repeat: no-repeat;
background-size: 1px 100%;
content: '';
display: -moz-box;
height: @tabHeight@;
width: 1px;
}
/* New tab button */
.tabs-newtab-button {
clip-path: url(chrome://browser/content/browser.xul#tab-clip-path-outer);
width: 66px;
}

Двоичные данные
browser/themes/windows/appmenu.png Normal file

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

После

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

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

@ -11,7 +11,8 @@
%define glassInactiveBorderColor rgb(102, 102, 102)
@media not all and (-moz-windows-classic) {
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container {
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container,
#main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
margin-top: 1px;
}
@ -47,27 +48,15 @@
background-color: @customToolbarColor@;
}
.tabbrowser-tab:not(:-moz-lwtheme),
.tabs-newtab-button:not(:-moz-lwtheme) {
background-image: @toolbarShadowOnTab@, @bgTabTexture@,
linear-gradient(@customToolbarColor@, @customToolbarColor@);
.tab-background-start[selected=true]:not(:-moz-lwtheme)::before,
.tab-background-end[selected=true]:not(:-moz-lwtheme)::before {
background-color: @customToolbarColor@;
background-image: @fgTabTexture@;
}
.tabbrowser-tab:not(:-moz-lwtheme):hover,
.tabs-newtab-button:not(:-moz-lwtheme):hover {
background-image: @toolbarShadowOnTab@, @bgTabTextureHover@,
linear-gradient(@customToolbarColor@, @customToolbarColor@);
}
.tabbrowser-tab[selected="true"]:not(:-moz-lwtheme) {
background-image: linear-gradient(#fff, @toolbarHighlight@ 50%),
linear-gradient(@customToolbarColor@, @customToolbarColor@);
}
#main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
background-image: @toolbarShadowOnTab@,
linear-gradient(#fff, @toolbarHighlight@ 50%),
linear-gradient(@customToolbarColor@, @customToolbarColor@);
.tab-background-middle[selected=true]:not(:-moz-lwtheme) {
background-image: url(chrome://browser/skin/tabbrowser/tab-active-middle.png),
linear-gradient(transparent, transparent 2px, @customToolbarColor@ 2px, @customToolbarColor@);
}
#navigator-toolbox:not(:-moz-lwtheme)::after {
@ -137,10 +126,6 @@
-moz-appearance: -moz-win-exclude-glass;
}
#main-window[chromemargin^="0,"][sizemode=normal] #navigator-toolbox {
margin-top: -7px;
}
/* Artificially draw window borders that are covered by lwtheme, see bug 591930. */
#main-window[sizemode="normal"] > #titlebar > #titlebar-content:-moz-lwtheme {
border-top: 2px solid;
@ -163,11 +148,6 @@
margin-bottom: -1px; /* compensate white outer border */
}
#main-window[sizemode=fullscreen]:not(:-moz-lwtheme) {
-moz-appearance: none;
background-color: #556;
}
#toolbar-menubar:not(:-moz-lwtheme),
#TabsToolbar[tabsontop=true]:not(:-moz-lwtheme),
#nav-bar[tabsontop=false]:not(:-moz-lwtheme),
@ -179,14 +159,13 @@
border-right-style: none !important;
}
:-moz-any(#toolbar-menubar, #nav-bar[tabsontop=false]) :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
#TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
#navigator-toolbox[tabsontop=false] > :-moz-any(#toolbar-menubar, #nav-bar) :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
#nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme) {
list-style-image: url("chrome://browser/skin/Toolbar-inverted.png");
}
:-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme),
:-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme),
#navigator-toolbox[tabsontop=false] > :-moz-any(#toolbar-menubar, #nav-bar) .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme),
#navigator-toolbox[tabsontop=false] > :-moz-any(#toolbar-menubar, #nav-bar) .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme),
#nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme),
#nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme) {
list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png");
@ -221,6 +200,16 @@
}
/* Toolbar shadow behind tabs */
#nav-bar[tabsontop=true]:not(:-moz-lwtheme),
#main-window[disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after {
border-top: 1px solid @toolbarShadowColor@;
background-clip: padding-box;
}
#main-window[disablechrome] #navigator-toolbox[tabsontop=true]:not(:-moz-lwtheme)::after {
visibility: visible;
}
/* This code is only needed for restored windows (i.e. sizemode=normal)
because of the border radius on the toolbar below the tab bar. */
#main-window[sizemode=normal] #nav-bar[tabsontop=true]:not(:-moz-lwtheme),
@ -232,12 +221,9 @@
border-top-right-radius: 2.5px;
background-clip: padding-box;
}
#main-window[sizemode=normal] #TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
#TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
margin-bottom: -1px;
background-image: none !important;
}
#main-window[sizemode=normal] #tabbrowser-tabs[tabsontop=true] > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox > .scrollbox-innerbox:not(:-moz-lwtheme) {
position: relative;
}
#navigator-toolbox[tabsontop=false] > #PersonalToolbar {
@ -335,6 +321,41 @@
}
}
@media (-moz-windows-glass) {
#main-window[sizemode=fullscreen]:not(:-moz-lwtheme) {
-moz-appearance: none;
background-color: #556;
}
/* Glass Fog */
#TabsToolbar:not(:-moz-lwtheme) {
background-image: none;
position: relative;
}
#TabsToolbar:not(:-moz-lwtheme)::before {
box-shadow: 0 0 30px 30px rgb(174,189,204);
content: "";
display: -moz-box;
height: 0;
margin: 0 60px; /* (30px + 30px) from box-shadow */
opacity: 0.85;
position: absolute;
pointer-events: none;
top: 50%;
width: -moz-available;
z-index: -1;
}
#main-window[sizemode=normal] #tabbrowser-tabs[tabsontop=true] > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox > .scrollbox-innerbox:not(:-moz-lwtheme) {
position: relative;
}
/* End Glass Fog */
}
@media not all and (-moz-windows-compositor) {
@media (-moz-windows-default-theme) {
#main-window {

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

@ -9,12 +9,10 @@
%include ../shared/browser.inc
%filter substitution
%define toolbarHighlight rgba(255,255,255,.5)
%define selectedTabHighlight rgba(255,255,255,.7)
%define toolbarShadowColor rgba(10%,10%,10%,.4)
%define toolbarShadowOnTab linear-gradient(to top, rgba(10%,10%,10%,.4) 1px, transparent 1px)
%define bgTabTexture linear-gradient(transparent, hsla(0,0%,45%,.1) 1px, hsla(0,0%,32%,.2) 80%, hsla(0,0%,0%,.2))
%define bgTabTextureHover linear-gradient(hsla(0,0%,100%,.3) 1px, hsla(0,0%,75%,.2) 80%, hsla(0,0%,60%,.2))
%define toolbarHighlight rgba(253,253,253,0.45)
%define toolbarShadowColor hsla(209,67%,12%,0.35)
%define fgTabTexture linear-gradient(rgba(254,254,254,0.72), rgba(254,254,254,0.72) 0px, rgba(250,250,250,0.88) 1px, rgba(250,250,250,0.88) 1px, rgba(254,254,254,0.72) 2px, @toolbarHighlight@)
%define fgTabBackgroundMiddle linear-gradient(transparent, transparent 2px, -moz-dialog 2px, -moz-dialog)
%define navbarTextboxCustomBorder border-color: rgba(0,0,0,.32);
%define navbarLargeIcons #navigator-toolbox[iconsize=large][mode=icons] > #nav-bar
%define forwardTransitionLength 150ms
@ -39,6 +37,21 @@
-moz-box-flex: 1; /* make menu items expand to fill toolbar height */
}
#main-window[tabsintitlebar][sizemode="normal"] #toolbar-menubar[autohide="true"][inactive="true"]:not([customizing="true"]) {
visibility: hidden;
}
#main-window[sizemode="normal"] #toolbar-menubar,
/* We want a 4px gap between the TabsToolbar and the toolbar-menubar when the
toolbar-menu is displayed in either restored or maximized mode. */
#main-window:not([sizemode="fullscreen"]) #toolbar-menubar:-moz-any(:not([autohide="true"]), :not([inactive="true"])) {
margin-bottom: 4px;
}
#toolbar-menubar:not([autohide="true"]) {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
}
#navigator-toolbox {
-moz-appearance: none;
background-color: transparent;
@ -66,12 +79,16 @@
%ifdef WINDOWS_AERO
@media not all and (-moz-windows-compositor) {
%endif
#main-window[tabsintitlebar]:not([inFullscreen]) #toolbar-menubar[inactive] ~ #TabsToolbar:not(:-moz-lwtheme) {
#toolbar-menubar {
background-color: transparent !important;
}
#main-window[tabsintitlebar][sizemode="maximized"] #toolbar-menubar[inactive] ~ #TabsToolbar:not(:-moz-lwtheme) {
background: linear-gradient(to top, @toolbarShadowColor@ 1px, transparent 1px),
linear-gradient(rgba(50%,50%,50%,0), ActiveCaption 85%);
color: CaptionText;
}
#main-window[tabsintitlebar]:not([inFullscreen]) #toolbar-menubar[inactive] ~ #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive {
#main-window[tabsintitlebar][sizemode="maximized"] #toolbar-menubar[inactive] ~ #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive {
background: linear-gradient(to top, @toolbarShadowColor@ 1px, transparent 1px),
linear-gradient(rgba(50%,50%,50%,0), InactiveCaption 85%);
color: InactiveCaptionText;
@ -108,6 +125,16 @@
/* ::::: app menu button ::::: */
/* The app menu button must appear on top of the navigator-toolbox in order
* for click and hover mouse events to work properly for the button in the
* restored window state. Otherwise, elements in the navigator-toolbox, like the
* menubar can swallow these events. It will also place the button above the
* fog on themes with Aero Glass.
*/
#main-window[tabsintitlebar] #appmenu-button-container {
z-index: 1;
}
#appmenu-button {
-moz-appearance: none;
background-clip: padding-box;
@ -130,6 +157,10 @@
%ifndef WINDOWS_AERO
@media (-moz-windows-default-theme) {
#main-window[tabsintitlebar][sizemode="normal"] #toolbar-menubar {
margin-top: 4px;
}
#main-window[sizemode="normal"] #appmenu-button {
margin-bottom: 5px;
}
@ -543,13 +574,21 @@
}
@media (-moz-windows-classic) {
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container {
#main-window[tabsintitlebar][sizemode="normal"] > #titlebar > #titlebar-content > #appmenu-button-container,
#main-window[tabsintitlebar][sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
margin-top: 4px;
}
}
/* The button box must appear on top of the navigator-toolbox in order for
* click and hover mouse events to work properly for the button in the restored
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
* can swallow those events. It will also place the buttons above the fog on
* themes with Aero Glass.
*/
#titlebar-buttonbox {
-moz-appearance: -moz-window-button-box;
z-index: 1;
}
#main-window[sizemode="maximized"] #titlebar-buttonbox {
@ -772,7 +811,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
-moz-box-pack: center;
}
@navbarLargeIcons@ .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#social-provider-button) {
@navbarLargeIcons@ .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#social-provider-button):not(#PanelUI-menu-button) {
padding-left: 5px;
padding-right: 5px;
}
@ -812,7 +851,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
padding: 3px 7px;
}
@navbarLargeIcons@ .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#social-provider-button) > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1[type=menu]:not(#back-button):not(#forward-button):not(#feed-button):not(#social-provider-button):not(#PanelUI-menu-button) > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1[type=menu] > .toolbarbutton-text /* hack for add-ons that forcefully display the label */ {
-moz-padding-end: 17px;
}
@ -1145,10 +1184,6 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
list-style-image: url(chrome://browser/skin/tabview/tabview.png);
}
%ifdef WINDOWS_AERO
:-moz-any(#TabsToolbar, #nav-bar[tabsontop=false], #toolbar-menubar) > #tabview-button:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
:-moz-any(#TabsToolbar, #nav-bar[tabsontop=false], #toolbar-menubar) > toolbarpaletteitem > #tabview-button:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
%endif
#tabview-button:-moz-lwtheme-brighttext {
list-style-image: url(chrome://browser/skin/tabview/tabview-inverted.png);
}
@ -1887,6 +1922,10 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-image: linear-gradient(to top, @toolbarShadowColor@ 1px, rgba(0,0,0,.05) 1px, transparent 50%);
}
#main-window[tabsintitlebar] #TabsToolbar {
background-color: transparent;
}
%ifndef WINDOWS_AERO
@media (-moz-windows-default-theme) {
#main-window[sizemode=normal] #TabsToolbar {
@ -1896,99 +1935,53 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
}
%endif
.tabbrowser-tab,
.tabs-newtab-button {
-moz-appearance: none;
background: @toolbarShadowOnTab@, @bgTabTexture@,
linear-gradient(-moz-dialog, -moz-dialog);
background-origin: border-box;
background-position: 1px 2px;
background-size: calc(100% - 2px) calc(100% - 2px);
background-repeat: no-repeat;
margin: 0;
padding: 2px 0 4px;
border-width: 4px 3px 0;
border-style: solid;
border-image: url(tabbrowser/tab.png) 4 3 0 fill repeat stretch;
border-radius: 0;
}
.tabbrowser-tab:hover,
.tabs-newtab-button:hover {
background-image: @toolbarShadowOnTab@, @bgTabTextureHover@,
linear-gradient(-moz-dialog, -moz-dialog);
}
%include ../shared/tabs.inc.css
%ifndef WINDOWS_AERO
/* Use lighter colors of buttons and text in the titlebar on luna-blue */
@media (-moz-windows-theme: luna-blue) {
.tabbrowser-tab,
.tabs-newtab-button {
background-image: @toolbarShadowOnTab@,
linear-gradient(hsla(51,34%,89%,.9), hsla(51,15%,79%,.9) 1px, hsla(51,9%,68%,.9));
#main-window[tabsintitlebar] #main-menubar > menu {
color: white;
}
.tabbrowser-tab:hover,
.tabs-newtab-button:hover {
background-image: @toolbarShadowOnTab@,
linear-gradient(hsla(51,34%,100%,.9), hsla(51,15%,94%,.9) 1px, hsla(51,9%,83%,.9));
#main-window[tabsintitlebar]:not([inFullscreen]) .tabbrowser-arrowscrollbox > .scrollbutton-up,
#main-window[tabsintitlebar]:not([inFullscreen]) .tabbrowser-arrowscrollbox > .scrollbutton-down {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-arrow-left-inverted.png);
}
#main-window[tabsintitlebar]:not([inFullscreen]) .tabs-newtab-button,
#main-window[tabsintitlebar]:not([inFullscreen]) #TabsToolbar > #new-tab-button,
#main-window[tabsintitlebar]:not([inFullscreen]) #TabsToolbar > toolbarpaletteitem > #new-tab-button {
list-style-image: url(chrome://browser/skin/tabbrowser/newtab-inverted.png);
}
#main-window[tabsintitlebar]:not([inFullscreen]) #TabsToolbar > #alltabs-button {
list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png");
}
#main-window[tabsintitlebar]:not([inFullscreen]) #TabsToolbar > #tabview-button {
list-style-image: url(chrome://browser/skin/tabview/tabview-inverted.png);
}
#main-window[tabsintitlebar]:not([inFullscreen]) .tab-close-button:not(:hover):not([selected="true"]) {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
}
%endif
.tabbrowser-tab[selected="true"] {
background-image: linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 50%),
linear-gradient(-moz-dialog, -moz-dialog);
}
#main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
background-image: @toolbarShadowOnTab@,
linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 50%),
linear-gradient(-moz-dialog, -moz-dialog);
#main-window[tabsintitlebar]:not([inFullscreen]) .tabbrowser-tab:not([selected]):not(:-moz-lwtheme) {
color: CaptionText;
}
.tabbrowser-tab:-moz-lwtheme {
color: inherit;
}
.tabbrowser-tab[selected="true"]:-moz-lwtheme {
background-image: linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 50%);
}
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]),
.tabs-newtab-button:-moz-lwtheme-brighttext {
background-image: linear-gradient(hsla(0,0%,40%,.6), hsla(0,0%,30%,.6) 80%);
}
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]):hover,
.tabs-newtab-button:-moz-lwtheme-brighttext:hover {
background-image: linear-gradient(hsla(0,0%,60%,.6), hsla(0,0%,45%,.6) 80%);
}
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]),
.tabs-newtab-button:-moz-lwtheme-darktext {
background-image: linear-gradient(hsla(0,0%,60%,.5), hsla(0,0%,45%,.5) 80%);
}
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]):hover,
.tabs-newtab-button:-moz-lwtheme-darktext:hover {
background-image: linear-gradient(hsla(0,0%,80%,.5), hsla(0,0%,60%,.5) 80%);
}
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
background-image: radial-gradient(circle farthest-corner at 50% 3px, rgba(255,255,255,1) 3%, rgba(186,221,251,.75) 40%, rgba(127,179,255,.5) 80%, rgba(127,179,255,.25));
}
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]):hover {
background-image: linear-gradient(hsla(0,0%,100%,.4), hsla(0,0%,75%,.4) 80%),
radial-gradient(circle farthest-corner at 50% 3px, rgba(255,255,255,1) 3%, rgba(186,221,251,.75) 40%, rgba(127,179,255,.5) 80%, rgba(127,179,255,.25));
}
.tab-throbber,
.tab-icon-image {
width: 16px;
height: 16px;
list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
-moz-margin-start: 2px;
-moz-margin-end: 3px;
}
.tab-throbber {
@ -1999,14 +1992,13 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
list-style-image: url("chrome://browser/skin/tabbrowser/loading.png");
}
.tab-throbber[pinned],
.tab-icon-image[pinned] {
-moz-margin-start: 5px;
-moz-margin-end: 5px;
.tab-throbber:not([pinned]),
.tab-icon-image:not([pinned]) {
-moz-margin-end: 6px;
}
/* tabbrowser-tab focus ring */
.tabbrowser-tab:focus > .tab-stack {
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
outline: 1px dotted;
}
@ -2019,7 +2011,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
/* Tab close button */
.tab-close-button {
-moz-appearance: none;
-moz-image-region: rect(0, 64px, 16px, 48px);
-moz-image-region: rect(0, 16px, 16px, 0);
-moz-margin-start: 6px;
border: none;
padding: 0px;
list-style-image: url("chrome://global/skin/icons/close.png");
@ -2050,10 +2043,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-origin: border-box;
}
%ifdef WINDOWS_AERO
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
%endif
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-lwtheme-brighttext,
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-lwtheme-brighttext {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-arrow-left-inverted.png);
@ -2097,20 +2086,12 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
-moz-image-region: auto;
}
%ifdef WINDOWS_AERO
#TabsToolbar > #new-tab-button:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
#TabsToolbar > toolbarpaletteitem > #new-tab-button:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
%endif
.tabs-newtab-button:-moz-lwtheme-brighttext,
#TabsToolbar > #new-tab-button:-moz-lwtheme-brighttext,
#TabsToolbar > toolbarpaletteitem > #new-tab-button:-moz-lwtheme-brighttext {
list-style-image: url(chrome://browser/skin/tabbrowser/newtab-inverted.png);
}
.tabs-newtab-button {
width: 28px;
}
#TabsToolbar > #new-tab-button {
width: 26px;
}
@ -2119,10 +2100,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow.png");
}
%ifdef WINDOWS_AERO
:-moz-any(#TabsToolbar, #nav-bar[tabsontop=false], #toolbar-menubar) > #alltabs-button:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
:-moz-any(#TabsToolbar, #nav-bar[tabsontop=false], #toolbar-menubar) > toolbarpaletteitem > #alltabs-button:-moz-system-metric(windows-compositor):not(:-moz-lwtheme),
%endif
#alltabs-button:-moz-lwtheme-brighttext {
list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png");
}
@ -2952,6 +2929,12 @@ chatbox {
border-top-right-radius: 2.5px;
}
/* Customization mode */
%include ../shared/customization.inc.css
/* End customization mode */
.click-to-play-plugins-notification-content {
margin: -10px;
border-radius: 4px;

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

После

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

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

@ -20,10 +20,12 @@ browser.jar:
skin/classic/browser/aboutSyncTabs.css
#endif
skin/classic/browser/actionicon-tab.png
skin/classic/browser/appmenu.png
skin/classic/browser/appmenu-icons.png
skin/classic/browser/appmenu-dropmarker.png
* skin/classic/browser/browser.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/customization/customization-mode-background.jpg (customization/customization-mode-background.jpg)
* skin/classic/browser/engineManager.css
skin/classic/browser/Geolocation-16.png
skin/classic/browser/Geolocation-64.png
@ -47,6 +49,7 @@ browser.jar:
skin/classic/browser/pageInfo.css
skin/classic/browser/pageInfo.png
skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png)
* skin/classic/browser/panelUIOverlay.css
skin/classic/browser/pointerLock-16.png
skin/classic/browser/pointerLock-64.png
skin/classic/browser/Privacy-16.png
@ -130,9 +133,15 @@ browser.jar:
skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png)
skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/browser/tabbrowser/tab.png (tabbrowser/tab.png)
skin/classic/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png)
skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png)
skin/classic/browser/tabbrowser/tab-background-middle.png (tabbrowser/tab-background-middle.png)
skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
skin/classic/browser/tabbrowser/tab-stroke-end.png (tabbrowser/tab-stroke-end.png)
skin/classic/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/tabview/close.png (tabview/close.png)
skin/classic/browser/tabview/edit-light.png (tabview/edit-light.png)
@ -266,10 +275,12 @@ browser.jar:
skin/classic/aero/browser/aboutSyncTabs.css
#endif
skin/classic/aero/browser/actionicon-tab.png
skin/classic/aero/browser/appmenu.png
skin/classic/aero/browser/appmenu-dropmarker.png
skin/classic/aero/browser/appmenu-icons.png
* skin/classic/aero/browser/browser.css (browser-aero.css)
skin/classic/aero/browser/click-to-play-warning-stripes.png
skin/classic/aero/browser/customization/customization-mode-background.jpg (customization/customization-mode-background.jpg)
* skin/classic/aero/browser/engineManager.css
skin/classic/aero/browser/Geolocation-16.png
skin/classic/aero/browser/Geolocation-64.png
@ -293,6 +304,7 @@ browser.jar:
skin/classic/aero/browser/pageInfo.css
skin/classic/aero/browser/pageInfo.png (pageInfo-aero.png)
skin/classic/aero/browser/page-livemarks.png (feeds/feedIcon16-aero.png)
* skin/classic/aero/browser/panelUIOverlay.css
skin/classic/aero/browser/pointerLock-16.png (pointerLock-16.png)
skin/classic/aero/browser/pointerLock-64.png (pointerLock-64.png)
skin/classic/aero/browser/Privacy-16.png (Privacy-16-aero.png)
@ -376,9 +388,15 @@ browser.jar:
skin/classic/aero/browser/tabbrowser/connecting.png (tabbrowser/connecting.png)
skin/classic/aero/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/aero/browser/tabbrowser/tab.png (tabbrowser/tab.png)
skin/classic/aero/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/aero/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
skin/classic/aero/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png)
skin/classic/aero/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png)
skin/classic/aero/browser/tabbrowser/tab-background-middle.png (tabbrowser/tab-background-middle.png)
skin/classic/aero/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/aero/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
skin/classic/aero/browser/tabbrowser/tab-stroke-end.png (tabbrowser/tab-stroke-end.png)
skin/classic/aero/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png)
skin/classic/aero/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/aero/browser/tabview/close.png (tabview/close.png)
skin/classic/aero/browser/tabview/edit-light.png (tabview/edit-light.png)

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

@ -0,0 +1,33 @@
/* 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/. */
%filter substitution
%define menuPanelWidth 23em
%include ../shared/panelUIOverlay.inc.css
.PanelUI-pageControls toolbarbutton {
list-style-image: url("chrome://browser/skin/Toolbar.png");
}
#PanelUI-cut-btn {
-moz-image-region: rect(0, 216px, 18px, 198px);
}
#PanelUI-copy-btn {
-moz-image-region: rect(0, 234px, 18px, 216px);
}
#PanelUI-paste-btn {
-moz-image-region: rect(0, 252px, 18px, 234px);
}
#PanelUI-zoomOut-btn {
-moz-image-region: rect(0, 288px, 18px, 270px);
padding-left: 12px;
padding-right: 12px;
}
#PanelUI-zoomIn-btn {
-moz-image-region: rect(0, 306px, 18px, 288px);
padding-left: 12px;
padding-right: 12px;
}

Двоичные данные
browser/themes/windows/tabbrowser/tab-active-middle.png Normal file

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

После

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

Двоичные данные
browser/themes/windows/tabbrowser/tab-background-end.png Normal file

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

После

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

Двоичные данные
browser/themes/windows/tabbrowser/tab-background-middle.png Normal file

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

После

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

Двоичные данные
browser/themes/windows/tabbrowser/tab-background-start.png Normal file

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

После

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

Двоичные данные
browser/themes/windows/tabbrowser/tab-stroke-end.png Normal file

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

После

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

Двоичные данные
browser/themes/windows/tabbrowser/tab-stroke-start.png Normal file

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

После

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

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

@ -41,6 +41,9 @@ LightweightThemeConsumer.prototype = {
_lastData: null,
_lastScreenWidth: null,
_lastScreenHeight: null,
#ifdef XP_MACOSX
_chromemarginDefault: undefined,
#endif
observe: function (aSubject, aTopic, aData) {
if (aTopic != "lightweight-theme-styling-update")
@ -108,10 +111,21 @@ LightweightThemeConsumer.prototype = {
}
#ifdef XP_MACOSX
if (active)
root.setAttribute("drawintitlebar", "true");
else
root.removeAttribute("drawintitlebar");
// Sample whether or not we draw in the titlebar by default the first time we update.
// If the root has no chromemargin attribute, getAttribute will return null, and
// we'll remove the attribute when the lw-theme is deactivated.
if (this._chromemarginDefault === undefined)
this._chromemarginDefault = root.getAttribute("chromemargin");
if (active) {
root.setAttribute("chromemargin", "0,-1,-1,-1");
}
else {
if (this._chromemarginDefault)
root.setAttribute("chromemargin", this._chromemarginDefault);
else
root.removeAttribute("chromemargin");
}
#endif
}
}

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

@ -272,20 +272,15 @@ toolbar[customizing="true"][hidden="true"] {
%ifdef XP_MACOSX
toolbar[type="menubar"] {
min-height: 0 !important;
border: 0 !important;
visibility: collapse;
}
%else
toolbar[type="menubar"][autohide="true"] {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-menubar-autohide");
overflow: hidden;
}
toolbar[type="menubar"][autohide="true"][inactive="true"]:not([customizing="true"]) {
min-height: 0 !important;
height: 0 !important;
-moz-appearance: none !important;
border-style: none !important;
visibility: collapse;
}
%endif

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

@ -9,7 +9,6 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
/* Page background */
*|*:root {
-moz-appearance: none;

Двоичные данные
toolkit/themes/windows/global/icons/close.png

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

До

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

После

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

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

@ -17,7 +17,7 @@
color: -moz-dialogText;
background-color: -moz-dialog;
background-image: /* Fade-out texture at the top, and blend with browser tab */
linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0) 30%),
linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0) 30%),
/* Texture */
url("chrome://global/skin/inContentUI/background-texture.png");
}

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

@ -557,6 +557,9 @@ public:
}
// unit conversion convenience functions
int32_t CocoaPointsToDevPixels(CGFloat aPts) {
return nsCocoaUtils::CocoaPointsToDevPixels(aPts, BackingScaleFactor());
}
nsIntPoint CocoaPointsToDevPixels(const NSPoint& aPt) {
return nsCocoaUtils::CocoaPointsToDevPixels(aPt, BackingScaleFactor());
}

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

@ -2045,23 +2045,29 @@ nsChildView::MaybeDrawRoundedBottomCorners(GLManager* aManager, nsIntRect aRect)
void
nsChildView::UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries)
{
NSWindow* win = [mView window];
if (!win || ![win isKindOfClass:[ToolbarWindow class]])
if (![mView window] || ![[mView window] isKindOfClass:[ToolbarWindow class]])
return;
float unifiedToolbarHeight = 0;
nsIntRect topPixelStrip(0, 0, [win frame].size.width, 1);
ToolbarWindow* win = (ToolbarWindow*)[mView window];
bool drawsContentsIntoWindowFrame = [win drawsContentsIntoWindowFrame];
int32_t windowWidth = mBounds.width;
int32_t titlebarHeight = CocoaPointsToDevPixels([win titlebarHeight]);
int32_t underTitlebarPos = drawsContentsIntoWindowFrame ? titlebarHeight : 0;
int32_t unifiedToolbarBottom = 0;
for (uint32_t i = 0; i < aThemeGeometries.Length(); ++i) {
const ThemeGeometry& g = aThemeGeometries[i];
if ((g.mWidgetType == NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR ||
g.mWidgetType == NS_THEME_TOOLBAR) &&
g.mRect.Contains(topPixelStrip)) {
unifiedToolbarHeight = g.mRect.YMost();
g.mRect.X() <= 0 &&
g.mRect.XMost() >= windowWidth &&
g.mRect.Y() <= underTitlebarPos) {
unifiedToolbarBottom = g.mRect.YMost();
}
}
[(ToolbarWindow*)win
setUnifiedToolbarHeight:DevPixelsToCocoaPoints(unifiedToolbarHeight)];
CGFloat unifiedHeight = DevPixelsToCocoaPoints(titlebarHeight + unifiedToolbarBottom - underTitlebarPos);
[win setUnifiedToolbarHeight:unifiedHeight];
}
NS_IMETHODIMP

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

@ -269,6 +269,7 @@ public:
virtual void SetShowsToolbarButton(bool aShow);
virtual void SetShowsFullScreenButton(bool aShow);
virtual void SetWindowAnimationType(WindowAnimationType aType);
NS_IMETHOD SetNonClientMargins(nsIntMargin &margins);
NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, bool aActive);
virtual void SetDrawsInTitlebar(bool aState);
virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,

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

@ -1954,6 +1954,15 @@ void nsCocoaWindow::SetWindowAnimationType(nsIWidget::WindowAnimationType aType)
mAnimationType = aType;
}
NS_IMETHODIMP nsCocoaWindow::SetNonClientMargins(nsIntMargin &margins)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
SetDrawsInTitlebar(margins.top == 0);
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
NS_IMETHODIMP nsCocoaWindow::SetWindowTitlebarColor(nscolor aColor, bool aActive)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
@ -2835,7 +2844,7 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
[super setBackgroundColor:mColor];
mBackgroundColor = [[NSColor whiteColor] retain];
mUnifiedToolbarHeight = 0.0f;
mUnifiedToolbarHeight = 22.0f;
// setBottomCornerRounded: is a private API call, so we check to make sure
// we respond to it just in case.
@ -2911,6 +2920,7 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
[self frame].size.width, [self titlebarHeight]);
}
// Returns the unified height of titlebar + toolbar.
- (float)unifiedToolbarHeight
{
return mUnifiedToolbarHeight;
@ -2922,15 +2932,16 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
return frameRect.size.height - [self contentRectForFrameRect:frameRect].size.height;
}
// Stores the complete height of titlebar + toolbar.
- (void)setUnifiedToolbarHeight:(float)aHeight
{
if ([self drawsContentsIntoWindowFrame] || aHeight == mUnifiedToolbarHeight)
if (aHeight == mUnifiedToolbarHeight)
return;
mUnifiedToolbarHeight = aHeight;
// Update sheet positioning hint.
[self setContentBorderThickness:mUnifiedToolbarHeight forEdge:NSMaxYEdge];
[self setContentBorderThickness:mUnifiedToolbarHeight - [self titlebarHeight] forEdge:NSMaxYEdge];
// Redraw the title bar. If we're inside painting, we'll do it right now,
// otherwise we'll just invalidate it.
@ -3125,18 +3136,18 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
static void
DrawNativeTitlebar(CGContextRef aContext, CGRect aTitlebarRect,
float aToolbarHeight, BOOL aIsMain)
float aUnifiedToolbarHeight, BOOL aIsMain)
{
if (aTitlebarRect.size.width * aTitlebarRect.size.height > CUIDRAW_MAX_AREA) {
return;
}
int unifiedHeight = aTitlebarRect.size.height + aToolbarHeight;
CUIDraw([NSWindow coreUIRenderer], aTitlebarRect, aContext,
(CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
@"kCUIWidgetWindowFrame", @"widget",
@"regularwin", @"windowtype",
(aIsMain ? @"normal" : @"inactive"), @"state",
[NSNumber numberWithInt:unifiedHeight], @"kCUIWindowFrameUnifiedTitleBarHeightKey",
[NSNumber numberWithInt:aUnifiedToolbarHeight], @"kCUIWindowFrameUnifiedTitleBarHeightKey",
[NSNumber numberWithBool:YES], @"kCUIWindowFrameDrawTitleSeparatorKey",
nil],
nil);

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

@ -107,6 +107,8 @@ protected:
NSWindow* aWindow);
void DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRect,
nsIFrame *aFrame);
void DrawNativeTitlebar(CGContextRef aContext, CGRect aTitlebarRect,
float aUnifiedHeight, BOOL aIsMain);
void DrawResizer(CGContextRef cgContext, const HIRect& aRect, nsIFrame *aFrame);
// Scrollbars

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

@ -1781,7 +1781,7 @@ nsNativeThemeCocoa::GetParentScrollbarFrame(nsIFrame *aFrame)
do {
if (scrollbarFrame->GetType() == nsGkAtoms::scrollbarFrame) break;
} while ((scrollbarFrame = scrollbarFrame->GetParent()));
// We return null if we can't find a parent scrollbar frame
return scrollbarFrame;
}
@ -1789,16 +1789,18 @@ nsNativeThemeCocoa::GetParentScrollbarFrame(nsIFrame *aFrame)
static bool
ToolbarCanBeUnified(CGContextRef cgContext, const HIRect& inBoxRect, NSWindow* aWindow)
{
if (![aWindow isKindOfClass:[ToolbarWindow class]] ||
[(ToolbarWindow*)aWindow drawsContentsIntoWindowFrame])
if (![aWindow isKindOfClass:[ToolbarWindow class]])
return false;
float unifiedToolbarHeight = [(ToolbarWindow*)aWindow unifiedToolbarHeight];
CGAffineTransform ctm = CGContextGetUserSpaceToDeviceSpaceTransform(cgContext);
CGRect deviceRect = CGRectApplyAffineTransform(inBoxRect, ctm);
ToolbarWindow* win = (ToolbarWindow*)aWindow;
float unifiedToolbarHeight = [win unifiedToolbarHeight];
float titlebarHeight = [win titlebarHeight];
bool drawsContentsIntoWindowFrame = [win drawsContentsIntoWindowFrame];
float underTitlebarPos = drawsContentsIntoWindowFrame ? titlebarHeight : 0;
return inBoxRect.origin.x == 0 &&
deviceRect.size.width >= [aWindow frame].size.width &&
inBoxRect.origin.y <= 0.0 &&
inBoxRect.size.width >= [win frame].size.width &&
inBoxRect.origin.y <= underTitlebarPos &&
floor(inBoxRect.origin.y + inBoxRect.size.height) <= unifiedToolbarHeight;
}
@ -1808,15 +1810,14 @@ nsNativeThemeCocoa::DrawUnifiedToolbar(CGContextRef cgContext, const HIRect& inB
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
float titlebarHeight = [(ToolbarWindow*)aWindow titlebarHeight];
float unifiedHeight = titlebarHeight + inBoxRect.size.height;
float unifiedHeight = [(ToolbarWindow*)aWindow unifiedToolbarHeight];
BOOL isMain = [aWindow isMainWindow];
CGContextSaveGState(cgContext);
CGContextClipToRect(cgContext, inBoxRect);
CGRect drawRect = CGRectOffset(inBoxRect, 0, -titlebarHeight);
CGRect drawRect = CGRectOffset(inBoxRect, 0, inBoxRect.size.height - unifiedHeight);
if (drawRect.size.width * drawRect.size.height <= CUIDRAW_MAX_AREA) {
CUIDraw([NSWindow coreUIRenderer], drawRect, cgContext,
(CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
@ -1872,6 +1873,34 @@ nsNativeThemeCocoa::DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRec
NS_OBJC_END_TRY_ABORT_BLOCK;
}
void
nsNativeThemeCocoa::DrawNativeTitlebar(CGContextRef aContext, CGRect aTitlebarRect,
float aUnifiedHeight, BOOL aIsMain)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
if (aTitlebarRect.size.width * aTitlebarRect.size.height > CUIDRAW_MAX_AREA) {
return;
}
CGContextSaveGState(aContext);
CUIDraw([NSWindow coreUIRenderer], aTitlebarRect, aContext,
(CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
@"kCUIWidgetWindowFrame", @"widget",
@"regularwin", @"windowtype",
(aIsMain ? @"normal" : @"inactive"), @"state",
[NSNumber numberWithInt:aUnifiedHeight], @"kCUIWindowFrameUnifiedTitleBarHeightKey",
[NSNumber numberWithBool:NO], @"kCUIWindowFrameDrawTitleSeparatorKey",
[NSNumber numberWithBool:YES], @"is.flipped",
nil],
nil);
CGContextRestoreGState(aContext);
NS_OBJC_END_TRY_ABORT_BLOCK;
}
static void
RenderResizer(CGContextRef cgContext, const HIRect& aRenderRect, void* aData)
{
@ -2134,6 +2163,14 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
break;
case NS_THEME_WINDOW_TITLEBAR: {
NSWindow* win = NativeWindowForFrame(aFrame);
BOOL isMain = [win isMainWindow];
float unifiedToolbarHeight = [(ToolbarWindow*)win unifiedToolbarHeight];
DrawNativeTitlebar(cgContext, macRect, unifiedToolbarHeight, isMain);
}
break;
case NS_THEME_TOOLBOX: {
HIThemeHeaderDrawInfo hdi = { 0, kThemeStateActive, kHIThemeHeaderKindWindow };
HIThemeDrawHeader(&macRect, &hdi, cgContext, HITHEME_ORIENTATION);
@ -2910,6 +2947,7 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
case NS_THEME_DIALOG:
case NS_THEME_WINDOW:
case NS_THEME_WINDOW_TITLEBAR:
case NS_THEME_MENUPOPUP:
case NS_THEME_MENUITEM:
case NS_THEME_MENUSEPARATOR: