From 9b24863cd6eebec3ecbd936fe440f626af16d175 Mon Sep 17 00:00:00 2001 From: "pamg.bugs%gmail.com" Date: Fri, 21 Jul 2006 17:05:56 +0000 Subject: [PATCH] Bug 345407, step 1: Move search-engine selection drop-down back to the engine icon. r=mconnor --- browser/base/content/browser.js | 6 +- browser/components/search/content/search.xml | 67 ++++++++++--------- .../search/content/searchbarBindings.css | 5 ++ .../themes/pinstripe/browser/searchbar.css | 35 +++++----- .../themes/winstripe/browser/searchbar.css | 39 ++++------- 5 files changed, 77 insertions(+), 75 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 1fd44abe361..376a79c5bb1 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -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; diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index 2529693edae..3ba2b4a493a 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -47,12 +47,15 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> - + + + @@ -71,32 +74,24 @@ showcommentcolumn="true" tabscrolling="true" xbl:inherits="disableautocomplete,searchengine,src"> - + + + + + + -# 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. - - - - - + anonid="search-go-button" /> @@ -516,24 +511,19 @@ + + + + + + + + + + + + diff --git a/browser/components/search/content/searchbarBindings.css b/browser/components/search/content/searchbarBindings.css index 19c4682309f..a081faefb2b 100644 --- a/browser/components/search/content/searchbarBindings.css +++ b/browser/components/search/content/searchbarBindings.css @@ -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; +} diff --git a/browser/themes/pinstripe/browser/searchbar.css b/browser/themes/pinstripe/browser/searchbar.css index 5275a6b63c7..90df0a25f63 100644 --- a/browser/themes/pinstripe/browser/searchbar.css +++ b/browser/themes/pinstripe/browser/searchbar.css @@ -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 -} diff --git a/browser/themes/winstripe/browser/searchbar.css b/browser/themes/winstripe/browser/searchbar.css index e36d0eaabb9..2e35d1d2f8f 100644 --- a/browser/themes/winstripe/browser/searchbar.css +++ b/browser/themes/winstripe/browser/searchbar.css @@ -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); }