mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 04:39:31 +00:00
Bug 345407, step 1: Move search-engine selection drop-down back to the engine icon. r=mconnor
This commit is contained in:
parent
192170513a
commit
e980b04aa6
@ -2972,9 +2972,9 @@ const BrowserSearch = {
|
|||||||
searchRelRegex.test(erel) && searchHrefRegex.test(ehref))
|
searchRelRegex.test(erel) && searchHrefRegex.test(ehref))
|
||||||
{
|
{
|
||||||
const targetDoc = target.ownerDocument;
|
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(),
|
var searchButton = document.getAnonymousElementByAttribute(this.getSearchBar(),
|
||||||
"anonid", "search-go-button");
|
"anonid", "searchbar-engine-button");
|
||||||
if (searchButton) {
|
if (searchButton) {
|
||||||
var browser = gBrowser.getBrowserForDocument(targetDoc);
|
var browser = gBrowser.getBrowserForDocument(targetDoc);
|
||||||
// Append the URI and an appropriate title to the browser data.
|
// Append the URI and an appropriate title to the browser data.
|
||||||
@ -3028,7 +3028,7 @@ const BrowserSearch = {
|
|||||||
*/
|
*/
|
||||||
updateSearchButton: function() {
|
updateSearchButton: function() {
|
||||||
var searchButton = document.getAnonymousElementByAttribute(this.getSearchBar(),
|
var searchButton = document.getAnonymousElementByAttribute(this.getSearchBar(),
|
||||||
"anonid", "search-go-button");
|
"anonid", "searchbar-engine-button");
|
||||||
if (!searchButton)
|
if (!searchButton)
|
||||||
return;
|
return;
|
||||||
var engines = gBrowser.mCurrentBrowser.engines;
|
var engines = gBrowser.mCurrentBrowser.engines;
|
||||||
|
@ -47,12 +47,15 @@
|
|||||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||||
|
|
||||||
<binding id="searchbar">
|
<binding id="searchbar-base">
|
||||||
<resources>
|
<resources>
|
||||||
<stylesheet src="chrome://browser/content/search/searchbarBindings.css"/>
|
<stylesheet src="chrome://browser/content/search/searchbarBindings.css"/>
|
||||||
<stylesheet src="chrome://browser/skin/searchbar.css"/>
|
<stylesheet src="chrome://browser/skin/searchbar.css"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
</binding>
|
||||||
|
|
||||||
|
<binding id="searchbar"
|
||||||
|
extends="chrome://browser/content/search/search.xml#searchbar-base">
|
||||||
<content>
|
<content>
|
||||||
<xul:stringbundle src="chrome://browser/locale/search.properties"
|
<xul:stringbundle src="chrome://browser/locale/search.properties"
|
||||||
anonid="searchbar-stringbundle"/>
|
anonid="searchbar-stringbundle"/>
|
||||||
@ -71,32 +74,24 @@
|
|||||||
showcommentcolumn="true"
|
showcommentcolumn="true"
|
||||||
tabscrolling="true"
|
tabscrolling="true"
|
||||||
xbl:inherits="disableautocomplete,searchengine,src">
|
xbl:inherits="disableautocomplete,searchengine,src">
|
||||||
<xul:image align="center"
|
<xul:button class="searchbar-engine-button"
|
||||||
class="searchbar-engine-image"
|
type="menu"
|
||||||
anonid="searchbar-engine-image"
|
anonid="searchbar-engine-button"
|
||||||
xbl:inherits="src"/>
|
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">
|
<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"
|
<xul:toolbarbutton class="search-go-button"
|
||||||
anonid="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>
|
|
||||||
</xul:hbox>
|
</xul:hbox>
|
||||||
</xul:textbox>
|
</xul:textbox>
|
||||||
</xul:box>
|
</xul:box>
|
||||||
@ -516,24 +511,19 @@
|
|||||||
<handler event="click"><![CDATA[
|
<handler event="click"><![CDATA[
|
||||||
const target = event.originalTarget;
|
const target = event.originalTarget;
|
||||||
var anonid = target.getAttribute("anonid");
|
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
|
/* We can't use checkForMiddleClick() from utilityOverlay.js here
|
||||||
because the button is using a command handler rather than an oncommand
|
because the button is using a command handler rather than an oncommand
|
||||||
attribute. The middle-click behavior itself (i.e., opening the search
|
attribute. The middle-click behavior itself (i.e., opening the search
|
||||||
in a new tab) is handled in handleSearchCommand().
|
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);
|
this.handleSearchCommand(event);
|
||||||
}
|
|
||||||
]]></handler>
|
]]></handler>
|
||||||
|
|
||||||
<handler event="command"><![CDATA[
|
<handler event="command"><![CDATA[
|
||||||
const target = event.originalTarget;
|
const target = event.originalTarget;
|
||||||
var anonid = target.getAttribute("anonid");
|
var anonid = target.getAttribute("anonid");
|
||||||
if (anonid == "button")
|
if (anonid == "search-go-button")
|
||||||
this.handleSearchCommand(event);
|
this.handleSearchCommand(event);
|
||||||
else if (anonid == "open-engine-manager")
|
else if (anonid == "open-engine-manager")
|
||||||
this.openManager(event);
|
this.openManager(event);
|
||||||
@ -822,4 +812,17 @@
|
|||||||
|
|
||||||
</handlers>
|
</handlers>
|
||||||
</binding>
|
</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>
|
</bindings>
|
||||||
|
@ -3,3 +3,8 @@
|
|||||||
.searchbar-textbox {
|
.searchbar-textbox {
|
||||||
-moz-binding: url("chrome://browser/content/search/search.xml#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");
|
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 {
|
.searchbar-popup {
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
}
|
}
|
||||||
@ -34,7 +52,7 @@
|
|||||||
border: none;
|
border: none;
|
||||||
padding-right: 0px;
|
padding-right: 0px;
|
||||||
height: 21px !important;
|
height: 21px !important;
|
||||||
margin: 0px -3px 0px -1px;
|
margin: 0px -5px 0px -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-go-button {
|
.search-go-button {
|
||||||
@ -44,10 +62,6 @@
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-go-button[addengines="true"] {
|
|
||||||
list-style-image: url("chrome://browser/skin/Search-add-engines.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-go-button:hover {
|
.search-go-button:hover {
|
||||||
-moz-image-region: rect(0px 32px 16px 16px);
|
-moz-image-region: rect(0px 32px 16px 16px);
|
||||||
}
|
}
|
||||||
@ -56,19 +70,10 @@
|
|||||||
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
-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);
|
-moz-image-region: rect(0px, 48px, 16px, 32px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchbar-engine-menuitem[selected="true"] > .menu-iconic-text {
|
.searchbar-engine-menuitem[selected="true"] > .menu-iconic-text {
|
||||||
font-weight: bold;
|
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;
|
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 {
|
.search-go-button-container {
|
||||||
border-left: 1px solid ThreeDShadow;
|
border-left: 1px solid ThreeDShadow;
|
||||||
}
|
}
|
||||||
@ -45,35 +59,10 @@
|
|||||||
border-bottom: 1px solid ThreeDShadow;
|
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 {
|
.search-go-button-container {
|
||||||
background-color: ThreeDFace;
|
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 {
|
.search-go-button:hover {
|
||||||
-moz-image-region: rect(0px 32px 16px 16px);
|
-moz-image-region: rect(0px 32px 16px 16px);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user