Bug 984188 - Don't invert icons for -moz-lwtheme-brighttext in the overflow panel. r=mikedeboer

[Australis]

--HG--
extra : rebase_source : a96b9b10b09f8084bdfda2a25d7526c5fce510ad
This commit is contained in:
Matthew Noorenberghe 2014-03-18 12:26:09 -07:00
parent 01d08bd495
commit 5c88c49909
4 changed files with 13 additions and 24 deletions

View File

@ -639,12 +639,14 @@
<toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional" <toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&backCmd.label;" label="&backCmd.label;"
command="Browser:BackOrBackDuplicate" command="Browser:BackOrBackDuplicate"
cui-areatype="toolbar"
onclick="checkForMiddleClick(this, event);" onclick="checkForMiddleClick(this, event);"
tooltip="back-button-tooltip" tooltip="back-button-tooltip"
context="backForwardMenu"/> context="backForwardMenu"/>
<toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional" <toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&forwardCmd.label;" label="&forwardCmd.label;"
command="Browser:ForwardOrForwardDuplicate" command="Browser:ForwardOrForwardDuplicate"
cui-areatype="toolbar"
onclick="checkForMiddleClick(this, event);" onclick="checkForMiddleClick(this, event);"
tooltip="forward-button-tooltip" tooltip="forward-button-tooltip"
context="backForwardMenu"/> context="backForwardMenu"/>
@ -893,14 +895,17 @@
<toolbarbutton id="nav-bar-overflow-button" <toolbarbutton id="nav-bar-overflow-button"
class="toolbarbutton-1 chromeclass-toolbar-additional overflow-button" class="toolbarbutton-1 chromeclass-toolbar-additional overflow-button"
cui-areatype="toolbar"
skipintoolbarset="true" skipintoolbarset="true"
tooltiptext="&navbarOverflow.label;"/> tooltiptext="&navbarOverflow.label;"/>
<toolbaritem id="PanelUI-button" <toolbaritem id="PanelUI-button"
class="chromeclass-toolbar-additional" class="chromeclass-toolbar-additional"
cui-areatype="toolbar"
removable="false"> removable="false">
<toolbarbutton id="PanelUI-menu-button" <toolbarbutton id="PanelUI-menu-button"
class="toolbarbutton-1" class="toolbarbutton-1"
cui-areatype="toolbar"
label="&brandShortName;" label="&brandShortName;"
tooltiptext="&appmenu.tooltip;"/> tooltiptext="&appmenu.tooltip;"/>
</toolbaritem> </toolbaritem>

View File

@ -73,6 +73,7 @@ function updateCombinedWidgetStyle(aNode, aArea, aModifyCloseMenu) {
if (aModifyCloseMenu) { if (aModifyCloseMenu) {
attrs.closemenu = inPanel ? "none" : null; attrs.closemenu = inPanel ? "none" : null;
} }
attrs["cui-areatype"] = aArea ? CustomizableUI.getAreaType(aArea) : null;
for (let i = 0, l = aNode.childNodes.length; i < l; ++i) { for (let i = 0, l = aNode.childNodes.length; i < l; ++i) {
if (aNode.childNodes[i].localName == "separator") if (aNode.childNodes[i].localName == "separator")
continue; continue;
@ -431,32 +432,21 @@ const CustomizableWidgets = [{
let areaType = CustomizableUI.getAreaType(this.currentArea); let areaType = CustomizableUI.getAreaType(this.currentArea);
let inPanel = areaType == CustomizableUI.TYPE_MENU_PANEL; let inPanel = areaType == CustomizableUI.TYPE_MENU_PANEL;
let inToolbar = areaType == CustomizableUI.TYPE_TOOLBAR; let inToolbar = areaType == CustomizableUI.TYPE_TOOLBAR;
let closeMenu = inPanel ? "none" : null;
let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
if (!this.currentArea)
cls = null;
let buttons = [{ let buttons = [{
id: "zoom-out-button", id: "zoom-out-button",
closemenu: closeMenu,
command: "cmd_fullZoomReduce", command: "cmd_fullZoomReduce",
class: cls,
label: true, label: true,
tooltiptext: "tooltiptext2", tooltiptext: "tooltiptext2",
shortcutId: "key_fullZoomReduce", shortcutId: "key_fullZoomReduce",
}, { }, {
id: "zoom-reset-button", id: "zoom-reset-button",
closemenu: closeMenu,
command: "cmd_fullZoomReset", command: "cmd_fullZoomReset",
class: cls,
tooltiptext: "tooltiptext2", tooltiptext: "tooltiptext2",
shortcutId: "key_fullZoomReset", shortcutId: "key_fullZoomReset",
}, { }, {
id: "zoom-in-button", id: "zoom-in-button",
closemenu: closeMenu,
command: "cmd_fullZoomEnlarge", command: "cmd_fullZoomEnlarge",
class: cls,
label: true, label: true,
tooltiptext: "tooltiptext2", tooltiptext: "tooltiptext2",
shortcutId: "key_fullZoomEnlarge", shortcutId: "key_fullZoomEnlarge",
@ -515,6 +505,7 @@ const CustomizableWidgets = [{
} }
updateZoomResetButton(); updateZoomResetButton();
} }
updateCombinedWidgetStyle(node, this.currentArea, true);
let listener = { let listener = {
onWidgetAdded: function(aWidgetId, aArea, aPosition) { onWidgetAdded: function(aWidgetId, aArea, aPosition) {
@ -609,30 +600,21 @@ const CustomizableWidgets = [{
type: "custom", type: "custom",
defaultArea: CustomizableUI.AREA_PANEL, defaultArea: CustomizableUI.AREA_PANEL,
onBuild: function(aDocument) { onBuild: function(aDocument) {
let inPanel = (this.currentArea == CustomizableUI.AREA_PANEL);
let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
if (!this.currentArea)
cls = null;
let buttons = [{ let buttons = [{
id: "cut-button", id: "cut-button",
command: "cmd_cut", command: "cmd_cut",
class: cls,
label: true, label: true,
tooltiptext: "tooltiptext2", tooltiptext: "tooltiptext2",
shortcutId: "key_cut", shortcutId: "key_cut",
}, { }, {
id: "copy-button", id: "copy-button",
command: "cmd_copy", command: "cmd_copy",
class: cls,
label: true, label: true,
tooltiptext: "tooltiptext2", tooltiptext: "tooltiptext2",
shortcutId: "key_copy", shortcutId: "key_copy",
}, { }, {
id: "paste-button", id: "paste-button",
command: "cmd_paste", command: "cmd_paste",
class: cls,
label: true, label: true,
tooltiptext: "tooltiptext2", tooltiptext: "tooltiptext2",
shortcutId: "key_paste", shortcutId: "key_paste",
@ -656,6 +638,8 @@ const CustomizableWidgets = [{
node.appendChild(btnNode); node.appendChild(btnNode);
}); });
updateCombinedWidgetStyle(node, this.currentArea);
let listener = { let listener = {
onWidgetAdded: function(aWidgetId, aArea, aPosition) { onWidgetAdded: function(aWidgetId, aArea, aPosition) {
if (aWidgetId != this.id) if (aWidgetId != this.id)

View File

@ -746,8 +746,8 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
list-style-image: url("chrome://browser/skin/Toolbar@2x.png"); list-style-image: url("chrome://browser/skin/Toolbar@2x.png");
} }
:-moz-any(@primaryToolbarButtons@):-moz-lwtheme-brighttext, :-moz-any(@primaryToolbarButtons@):not(@inAnyPanel@):-moz-lwtheme-brighttext,
#bookmarks-menu-button[cui-areatype="toolbar"]:-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { #bookmarks-menu-button:not(@inAnyPanel@):-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
list-style-image: url("chrome://browser/skin/Toolbar-inverted@2x.png"); list-style-image: url("chrome://browser/skin/Toolbar-inverted@2x.png");
} }

View File

@ -3,8 +3,8 @@
list-style-image: url("chrome://browser/skin/Toolbar.png"); list-style-image: url("chrome://browser/skin/Toolbar.png");
} }
:-moz-any(@primaryToolbarButtons@):-moz-lwtheme-brighttext, :-moz-any(@primaryToolbarButtons@):not(@inAnyPanel@):-moz-lwtheme-brighttext,
#bookmarks-menu-button:-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon { #bookmarks-menu-button:not(@inAnyPanel@):-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
list-style-image: url(chrome://browser/skin/Toolbar-inverted.png); list-style-image: url(chrome://browser/skin/Toolbar-inverted.png);
} }