зеркало из https://github.com/mozilla/pjs.git
Bug 345407, step 1: Move search-engine selection drop-down back to the engine icon. r=mconnor
This commit is contained in:
Родитель
5f8e71260b
Коммит
9b24863cd6
|
@ -2972,9 +2972,9 @@ const BrowserSearch = {
|
|||
searchRelRegex.test(erel) && searchHrefRegex.test(ehref))
|
||||
{
|
||||
const targetDoc = target.ownerDocument;
|
||||
// Set the attribute of the (first) search button.
|
||||
// Set the attribute of the (first) search-engine button.
|
||||
var searchButton = document.getAnonymousElementByAttribute(this.getSearchBar(),
|
||||
"anonid", "search-go-button");
|
||||
"anonid", "searchbar-engine-button");
|
||||
if (searchButton) {
|
||||
var browser = gBrowser.getBrowserForDocument(targetDoc);
|
||||
// Append the URI and an appropriate title to the browser data.
|
||||
|
@ -3028,7 +3028,7 @@ const BrowserSearch = {
|
|||
*/
|
||||
updateSearchButton: function() {
|
||||
var searchButton = document.getAnonymousElementByAttribute(this.getSearchBar(),
|
||||
"anonid", "search-go-button");
|
||||
"anonid", "searchbar-engine-button");
|
||||
if (!searchButton)
|
||||
return;
|
||||
var engines = gBrowser.mCurrentBrowser.engines;
|
||||
|
|
|
@ -47,12 +47,15 @@
|
|||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="searchbar">
|
||||
<binding id="searchbar-base">
|
||||
<resources>
|
||||
<stylesheet src="chrome://browser/content/search/searchbarBindings.css"/>
|
||||
<stylesheet src="chrome://browser/skin/searchbar.css"/>
|
||||
</resources>
|
||||
</binding>
|
||||
|
||||
<binding id="searchbar"
|
||||
extends="chrome://browser/content/search/search.xml#searchbar-base">
|
||||
<content>
|
||||
<xul:stringbundle src="chrome://browser/locale/search.properties"
|
||||
anonid="searchbar-stringbundle"/>
|
||||
|
@ -71,32 +74,24 @@
|
|||
showcommentcolumn="true"
|
||||
tabscrolling="true"
|
||||
xbl:inherits="disableautocomplete,searchengine,src">
|
||||
<xul:image align="center"
|
||||
class="searchbar-engine-image"
|
||||
anonid="searchbar-engine-image"
|
||||
xbl:inherits="src"/>
|
||||
<xul:button class="searchbar-engine-button"
|
||||
type="menu"
|
||||
anonid="searchbar-engine-button"
|
||||
popup="_child"
|
||||
xbl:inherits="src">
|
||||
<xul:menupopup class="searchbar-popup"
|
||||
anonid="searchbar-popup"
|
||||
position="after_start">
|
||||
<xul:menuseparator/>
|
||||
<xul:menuitem class="open-engine-manager"
|
||||
anonid="open-engine-manager"
|
||||
label="&cmd_engineManager.label;"
|
||||
accesskey="&cmd_engineManager.accesskey;"/>
|
||||
</xul:menupopup>
|
||||
</xul:button>
|
||||
<xul:hbox class="search-go-button-container">
|
||||
# XXX We'd like to add a context="_child" property to this toolbarbutton, but doing
|
||||
# so causes the context menu to show up for the textbox too, and subsequently crashes
|
||||
# the app on shutdown. See bug 336662.
|
||||
#
|
||||
# XXX We'd also like to specify the menupopup position as after_end, as well as
|
||||
# probably adjusting its length to match that of the searchbar so the search
|
||||
# engine icons line up, but that's prevented by inconsistent behavior of the
|
||||
# popup position within a toolbarbutton. See bug 336868.
|
||||
<xul:toolbarbutton class="search-go-button"
|
||||
anonid="search-go-button"
|
||||
type="menu-button">
|
||||
<xul:menupopup class="searchbar-popup"
|
||||
anonid="searchbar-popup"
|
||||
position="after_start">
|
||||
<xul:menuseparator/>
|
||||
<xul:menuitem class="open-engine-manager"
|
||||
anonid="open-engine-manager"
|
||||
label="&cmd_engineManager.label;"
|
||||
accesskey="&cmd_engineManager.accesskey;"/>
|
||||
</xul:menupopup>
|
||||
</xul:toolbarbutton>
|
||||
anonid="search-go-button" />
|
||||
</xul:hbox>
|
||||
</xul:textbox>
|
||||
</xul:box>
|
||||
|
@ -516,24 +511,19 @@
|
|||
<handler event="click"><![CDATA[
|
||||
const target = event.originalTarget;
|
||||
var anonid = target.getAttribute("anonid");
|
||||
if (anonid == "searchbar-engine-image") {
|
||||
this._textbox.focus();
|
||||
this._textbox.select();
|
||||
}
|
||||
/* We can't use checkForMiddleClick() from utilityOverlay.js here
|
||||
because the button is using a command handler rather than an oncommand
|
||||
attribute. The middle-click behavior itself (i.e., opening the search
|
||||
in a new tab) is handled in handleSearchCommand().
|
||||
*/
|
||||
else if (anonid == "button" && event.button == 1) {
|
||||
if (anonid == "search-go-button" && event.button == 1)
|
||||
this.handleSearchCommand(event);
|
||||
}
|
||||
]]></handler>
|
||||
|
||||
<handler event="command"><![CDATA[
|
||||
const target = event.originalTarget;
|
||||
var anonid = target.getAttribute("anonid");
|
||||
if (anonid == "button")
|
||||
if (anonid == "search-go-button")
|
||||
this.handleSearchCommand(event);
|
||||
else if (anonid == "open-engine-manager")
|
||||
this.openManager(event);
|
||||
|
@ -822,4 +812,17 @@
|
|||
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="searchbar-engine-button"
|
||||
extends="chrome://browser/content/search/search.xml#searchbar-base">
|
||||
<content>
|
||||
<xul:stack flex="1">
|
||||
<xul:hbox align="center" class="searchbar-engine-image-container">
|
||||
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
|
||||
</xul:hbox>
|
||||
<xul:image class="searchbar-dropmarker-image"/>
|
||||
</xul:stack>
|
||||
<children/>
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
||||
|
|
|
@ -3,3 +3,8 @@
|
|||
.searchbar-textbox {
|
||||
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar-textbox");
|
||||
}
|
||||
|
||||
.searchbar-engine-button {
|
||||
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar-engine-button");
|
||||
-moz-user-focus: none;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,24 @@
|
|||
list-style-image: url("chrome://browser/skin/bookmarks/bookmark-item.png");
|
||||
}
|
||||
|
||||
.searchbar-engine-button {
|
||||
min-width: 22px;
|
||||
margin: 0px 3px 0px 0px;
|
||||
}
|
||||
|
||||
.searchbar-engine-button[addengines="true"] {
|
||||
list-style-image: url("chrome://browser/skin/Search-add-engines.png");
|
||||
}
|
||||
|
||||
.searchbar-dropmarker-image {
|
||||
%ifdef MOZ_PLACES
|
||||
list-style-image: url("chrome://browser/skin/places/folderDropArrow.png") !important;
|
||||
%else
|
||||
list-style-image: url("chrome://global/skin/arrow/arrow-dn.png") !important;
|
||||
%endif
|
||||
padding: 8px 0px 7px 19px;
|
||||
}
|
||||
|
||||
.searchbar-popup {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
@ -34,7 +52,7 @@
|
|||
border: none;
|
||||
padding-right: 0px;
|
||||
height: 21px !important;
|
||||
margin: 0px -3px 0px -1px;
|
||||
margin: 0px -5px 0px -3px;
|
||||
}
|
||||
|
||||
.search-go-button {
|
||||
|
@ -44,10 +62,6 @@
|
|||
padding: 0px;
|
||||
}
|
||||
|
||||
.search-go-button[addengines="true"] {
|
||||
list-style-image: url("chrome://browser/skin/Search-add-engines.png");
|
||||
}
|
||||
|
||||
.search-go-button:hover {
|
||||
-moz-image-region: rect(0px 32px 16px 16px);
|
||||
}
|
||||
|
@ -56,19 +70,10 @@
|
|||
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.search-go-button[disabled="true"]{
|
||||
.search-go-button[disabled="true"] {
|
||||
-moz-image-region: rect(0px, 48px, 16px, 32px);
|
||||
}
|
||||
|
||||
.searchbar-engine-menuitem[selected="true"] > .menu-iconic-text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.search-go-button .toolbarbutton-menubutton-dropmarker {
|
||||
%ifdef MOZ_PLACES
|
||||
list-style-image: url("chrome://browser/skin/places/folderDropArrow.png") !important;
|
||||
%else
|
||||
list-style-image: url("chrome://browser/skin/bookmarks/folderarrow.png") !important;
|
||||
%endif
|
||||
}
|
||||
|
|
|
@ -14,6 +14,20 @@
|
|||
min-width: 100px;
|
||||
}
|
||||
|
||||
.searchbar-engine-button {
|
||||
min-width: 22px;
|
||||
margin: 0px 3px 0px 0px;
|
||||
}
|
||||
|
||||
.searchbar-engine-button[addengines="true"] {
|
||||
list-style-image: url("chrome://browser/skin/Search-add-engines.png");
|
||||
}
|
||||
|
||||
.searchbar-dropmarker-image {
|
||||
list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
|
||||
padding: 8px 0px 7px 20px;
|
||||
}
|
||||
|
||||
.search-go-button-container {
|
||||
border-left: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
@ -45,35 +59,10 @@
|
|||
border-bottom: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
.search-go-button > .toolbarbutton-menubutton-button {
|
||||
padding: 1px !important;
|
||||
border: none;
|
||||
border-right: 2px solid ThreeDFace;
|
||||
-moz-appearance: none;
|
||||
min-width: 0px !important;
|
||||
}
|
||||
|
||||
.search-go-button > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
|
||||
.search-go-button > .toolbarbutton-menubutton-button > .toolbarbutton-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.search-go-button-container {
|
||||
background-color: ThreeDFace;
|
||||
}
|
||||
|
||||
.search-go-button > .toolbarbutton-menubutton-dropmarker {
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.search-go-button[addengines="true"] {
|
||||
list-style-image: url("chrome://browser/skin/Search-add-engines.png");
|
||||
}
|
||||
|
||||
.search-go-button:hover {
|
||||
-moz-image-region: rect(0px 32px 16px 16px);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче