Bug 544816 - Attach combined Stop/Go/Refresh button to the Location Bar. r=dolske, ui-r=shorlander, a=dolske

This commit is contained in:
Frank Yan 2010-09-02 19:20:12 -07:00
parent 280fb8412f
commit d10ba6b3bb
14 changed files with 263 additions and 34 deletions

View File

@ -100,6 +100,13 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
display: none;
}
#wrapper-urlbar-container #urlbar-container > #urlbar > toolbarbutton,
#urlbar-container:not([combined]) > #urlbar > toolbarbutton,
#urlbar-container[combined] + #reload-button + #stop-button,
#urlbar-container[combined] + #reload-button,
toolbar:not([mode="icons"]) > #urlbar-container > #urlbar > toolbarbutton,
toolbar[mode="icons"] > #urlbar-container > #urlbar > #urlbar-reload-button:not([displaystop]) + #urlbar-stop-button,
toolbar[mode="icons"] > #urlbar-container > #urlbar > #urlbar-reload-button[displaystop],
toolbar[mode="icons"] > #reload-button:not([displaystop]) + #stop-button,
toolbar[mode="icons"] > #reload-button[displaystop] {
visibility: collapse;
@ -178,8 +185,12 @@ richlistitem[type~="action"]:-moz-locale-dir(rtl) > .ac-url-box {
direction: rtl;
}
#urlbar-container[combined] > #urlbar > #urlbar-icons > #go-button,
#urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon:not(#go-button),
#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button {
#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button,
#urlbar[pageproxystate="invalid"][focused="true"] > #urlbar-go-button ~ toolbarbutton,
#urlbar[pageproxystate="valid"] > #urlbar-go-button,
#urlbar:not([focused="true"]) > #urlbar-go-button {
visibility: collapse;
}

View File

@ -2360,10 +2360,13 @@ function UpdateUrlbarSearchSplitterState()
var splitter = document.getElementById("urlbar-search-splitter");
var urlbar = document.getElementById("urlbar-container");
var searchbar = document.getElementById("search-container");
var stop = document.getElementById("stop-button");
var ibefore = null;
if (urlbar && searchbar) {
if (urlbar.nextSibling == searchbar)
if (urlbar.nextSibling == searchbar ||
urlbar.getAttribute("combined") &&
stop && stop.nextSibling == searchbar)
ibefore = searchbar;
else if (searchbar.nextSibling == urlbar)
ibefore = urlbar;
@ -4456,23 +4459,30 @@ var CombinedStopReload = {
if (this._initialized)
return;
var stop = document.getElementById("stop-button");
if (!stop)
return;
var urlbar = document.getElementById("urlbar-container");
var reload = document.getElementById("reload-button");
if (!reload)
return;
var stop = document.getElementById("stop-button");
if (!(reload.nextSibling == stop))
if (urlbar) {
if (urlbar.parentNode.getAttribute("mode") != "icons" ||
!reload || urlbar.nextSibling != reload ||
!stop || reload.nextSibling != stop)
urlbar.removeAttribute("combined");
else {
urlbar.setAttribute("combined", "true");
reload = document.getElementById("urlbar-reload-button");
stop = document.getElementById("urlbar-stop-button");
}
}
if (!stop || !reload || reload.nextSibling != stop)
return;
this._initialized = true;
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
reload.setAttribute("displaystop", "true");
stop.addEventListener("click", this, false);
this.stop = stop;
this.reload = reload;
this.stop = stop;
},
uninit: function () {

View File

@ -790,10 +790,10 @@
fullscreentoolbar="true" mode="icons" customizable="true"
#ifdef WINCE
iconsize="small" defaulticonsize="small"
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,bookmarks-menu-button-container,navigator-throbber,fullscreenflex,window-controls"
defaultset="unified-back-forward-button,home-button,urlbar-container,reload-button,stop-button,search-container,bookmarks-menu-button-container,navigator-throbber,fullscreenflex,window-controls"
#else
iconsize="large"
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,bookmarks-menu-button-container,fullscreenflex,window-controls"
defaultset="unified-back-forward-button,home-button,urlbar-container,reload-button,stop-button,search-container,bookmarks-menu-button-container,fullscreenflex,window-controls"
#endif
context="toolbar-context-menu">
@ -827,17 +827,6 @@
</toolbarbutton>
</toolbaritem>
<toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&reloadCmd.label;" removable="true"
command="Browser:ReloadOrDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&reloadButton.tooltip;"/>
<toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&stopCmd.label;" removable="true"
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>
<toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
persist="class" removable="true"
label="&homeButton.label;"
@ -919,9 +908,30 @@
tooltiptext="&goEndCap.tooltip;"
onclick="gURLBar.handleCommand(event);"/>
</hbox>
<toolbarbutton id="urlbar-go-button"
onclick="gURLBar.handleCommand(event);"
tooltiptext="&goEndCap.tooltip;"/>
<toolbarbutton id="urlbar-reload-button"
command="Browser:ReloadOrDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&reloadButton.tooltip;"/>
<toolbarbutton id="urlbar-stop-button"
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>
</textbox>
</toolbaritem>
<toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&reloadCmd.label;" removable="true"
command="Browser:ReloadOrDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&reloadButton.tooltip;"/>
<toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&stopCmd.label;" removable="true"
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">

View File

@ -589,7 +589,7 @@ BrowserGlue.prototype = {
var buttonAccessKey = rightsBundle.GetStringFromName("buttonAccessKey");
var productName = brandBundle.GetStringFromName("brandFullName");
var notifyRightsText = rightsBundle.formatStringFromName("notifyRightsText", [productName], 1);
var buttons = [
{
label: buttonLabel,
@ -995,7 +995,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
const UI_VERSION = 2;
const UI_VERSION = 3;
let currentUIVersion = 0;
try {
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
@ -1053,6 +1053,25 @@ BrowserGlue.prototype = {
}
}
if (currentUIVersion < 3) {
// This code merges the reload/stop/go button into the url bar.
let currentsetResource = this._rdf.GetResource("currentset");
let toolbarResource = this._rdf.GetResource("chrome://browser/content/browser.xul#nav-bar");
let currentset = this._getPersist(toolbarResource, currentsetResource);
// Need to migrate only if toolbar is customized and all 3 elements are found.
if (currentset &&
currentset.indexOf("reload-button") != -1 &&
currentset.indexOf("stop-button") != -1 &&
currentset.indexOf("urlbar-container") != -1 &&
currentset.indexOf("urlbar-container,reload-button,stop-button") == -1) {
currentset = currentset.replace(/(^|,)reload-button($|,)/, "$1$2").
replace(/(^|,)stop-button($|,)/, "$1$2").
replace(/(^|,)urlbar-container($|,)/,
"$1urlbar-container,reload-button,stop-button$2");
this._setPersist(toolbarResource, currentsetResource, currentset);
}
}
if (this._dirty)
this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
@ -1090,7 +1109,7 @@ BrowserGlue.prototype = {
// ------------------------------
// public nsIBrowserGlue members
// ------------------------------
sanitize: function BG_sanitize(aParentWindow) {
this._sanitizer.sanitize(aParentWindow);
},
@ -1229,7 +1248,7 @@ BrowserGlue.prototype = {
SMART_BOOKMARKS_ANNO, smartBookmark.queryId,
0, annosvc.EXPIRE_NEVER);
}
// If we are creating all Smart Bookmarks from ground up, add a
// separator below them in the bookmarks menu.
if (smartBookmarksCurrentVersion == 0 &&
@ -1324,7 +1343,7 @@ GeolocationPrompt.prototype = {
request.allow();
return;
}
if (result == Ci.nsIPermissionManager.DENY_ACTION) {
request.cancel();
return;

View File

@ -701,7 +701,7 @@ toolbar[iconsize="small"] #reload-button[disabled="true"] {
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu&state=disabled");
}
toolbar[iconsize="small"] #home-button ,
toolbar[iconsize="small"] #home-button,
#home-button.bookmark-item {
list-style-image: url("moz-icon://stock/gtk-home?size=menu");
}
@ -787,6 +787,7 @@ toolbar[iconsize="small"] #fullscreen-button {
width: 7em;
min-width: 7em;
-moz-appearance: textfield;
padding: 0;
}
#urlbar > .autocomplete-textbox-container {
@ -1113,11 +1114,72 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
}
/* Go button */
#go-button {
padding: 3px 2px 2px 2px;
list-style-image: url("chrome://browser/skin/Go-arrow.png");
}
/* Combined go/reload/stop button in location bar */
#urlbar > toolbarbutton {
-moz-appearance: none;
list-style-image: url("chrome://browser/skin/reload-stop-go.png");
margin: -1px;
-moz-margin-start: 0;
padding: 0 3px;
background-origin: border-box;
border: none;
border-left: 1px solid rgba(0,0,0,.35);
-moz-border-radius-topright: 2px;
-moz-border-radius-bottomright: 2px;
}
#urlbar > toolbarbutton:active:hover {
padding-left: 4px;
border-left: none;
-moz-box-shadow: 0 0 9px rgba(0,0,0,.4) inset,
0 0 3px rgba(0,0,0,.4) inset;
}
#urlbar-go-button {
-moz-image-region: rect(0px, 56px, 14px, 42px);
background-image: -moz-linear-gradient(rgb(143,219,69), rgb(115,177,57));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 0 rgba(255,255,255,.2) inset;
}
#urlbar-go-button:hover {
background-image: -moz-linear-gradient(rgb(163,232,92), rgb(137,196,81));
}
#urlbar-reload-button {
-moz-image-region: rect(0px, 14px, 14px, 0px);
}
#urlbar-reload-button:hover {
-moz-image-region: rect(0px, 28px, 14px, 14px);
background-image: -moz-linear-gradient(rgb(137,183,233), rgb(79,130,195));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 0 rgba(255,255,255,.2) inset;
}
#urlbar-stop-button {
-moz-image-region: rect(0px, 42px, 14px, 28px);
background-image: -moz-linear-gradient(rgb(226,99,99), rgb(199,68,68));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 0 rgba(255,255,255,.2) inset;
}
#urlbar-stop-button:hover {
background-image: -moz-linear-gradient(rgb(237,120,120), rgb(216,92,92));
}
#urlbar-stop-button[disabled="true"] > .toolbarbutton-icon {
opacity: .5;
}
/* Star button */
#star-button {
padding: 1px;

View File

@ -26,6 +26,7 @@ browser.jar:
skin/classic/browser/page-livemarks.png
skin/classic/browser/Privacy-16.png
skin/classic/browser/Privacy-48.png
skin/classic/browser/reload-stop-go.png
skin/classic/browser/searchbar.css (searchbar.css)
skin/classic/browser/section_collapsed.png
skin/classic/browser/section_collapsed-rtl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -691,6 +691,9 @@ toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl) {
#urlbar {
-moz-border-radius: @toolbarbuttonCornerRadius@;
direction: ltr;
}
#urlbar-container:not([combined]) > #urlbar {
-moz-padding-end: 3px;
}
@ -899,15 +902,64 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
#go-button {
list-style-image: url("chrome://browser/skin/Go-arrow.png");
-moz-image-region: rect(0px, 16px, 16px, 0px);
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
#go-button:hover {
-moz-image-region: rect(0px, 32px, 16px, 16px);
-moz-image-region: rect(0px, 32px, 16px, 16px);
}
#go-button:hover:active {
-moz-image-region: rect(0px, 48px, 16px, 32px);
-moz-image-region: rect(0px, 48px, 16px, 32px);
}
/* ----- COMBINED GO/RELOAD/STOP BUTTON IN LOCATION BAR ----- */
#urlbar > toolbarbutton {
list-style-image: url("chrome://browser/skin/reload-stop-go.png");
margin: 0;
-moz-margin-start: 2px;
padding: 0 3px;
background-origin: border-box;
border: none;
border-left: 1px solid rgba(0,0,0,.25);
-moz-border-radius-topright: 2px;
-moz-border-radius-bottomright: 2px;
}
#urlbar > toolbarbutton:active:hover {
-moz-box-shadow: @toolbarbuttonPressedInnerShadow@;
padding-left: 4px;
border-left: none;
}
#urlbar-go-button {
-moz-image-region: rect(0px, 56px, 14px, 42px);
background-image: -moz-linear-gradient(rgb(184,221,142), rgb(154,201,111) 49%, rgb(130,187,92) 51%, rgb(114,171,79));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 1px rgba(255,255,255,.15) inset;
}
#urlbar-reload-button {
-moz-image-region: rect(0px, 14px, 14px, 0px);
}
#urlbar-reload-button:hover {
-moz-image-region: rect(0px, 28px, 14px, 14px);
background-image: -moz-linear-gradient(rgb(162,207,241), rgb(111,178,225) 49%, rgb(91,159,217) 51%, rgb(62,138,200));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 1px rgba(255,255,255,.15) inset;
}
#urlbar-stop-button {
-moz-image-region: rect(0px, 42px, 14px, 28px);
background-image: -moz-linear-gradient(rgb(231,162,140), rgb(209,119,100) 49%, rgb(193,92,78) 51%, rgb(173,72,58));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 1px rgba(255,255,255,.15) inset;
}
#urlbar-stop-button[disabled="true"] > .toolbarbutton-icon {
opacity: .4;
}
/* STAR BUTTON */

View File

@ -41,6 +41,7 @@ browser.jar:
skin/classic/browser/Popup-blocked.png
skin/classic/browser/Privacy-16.png
skin/classic/browser/Privacy-48.png
skin/classic/browser/reload-stop-go.png
skin/classic/browser/searchbar-dropmarker.png
skin/classic/browser/searchbar.css
skin/classic/browser/Search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1181,11 +1181,70 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
#go-button {
list-style-image: url("chrome://browser/skin/Go-arrow.png");
-moz-image-region: rect(0px 16px 16px 0px);
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
#go-button:hover {
-moz-image-region: rect(16px 16px 32px 0px);
-moz-image-region: rect(16px, 16px, 32px, 0px);
}
/* combined go/reload/stop button in location bar */
#urlbar > toolbarbutton {
-moz-appearance: none;
list-style-image: url("chrome://browser/skin/reload-stop-go.png");
margin: -2px;
-moz-margin-start: 0;
padding: 0 3px;
background-origin: border-box;
border: none;
border-left: 1px solid rgba(0,0,0,.25);
-moz-border-radius-topright: 2px;
-moz-border-radius-bottomright: 2px;
}
#urlbar > toolbarbutton:active:hover {
padding-left: 4px;
border-left: none;
-moz-box-shadow: 0 0 9px rgba(0,0,0,.4) inset,
0 0 3px rgba(0,0,0,.4) inset;
}
#urlbar-go-button {
-moz-image-region: rect(0px, 56px, 14px, 42px);
background-image: -moz-linear-gradient(rgb(115,213,115), rgb(96,190,96) 49%, rgb(82,174,82) 51%, rgb(79,155,79));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 1px rgba(255,255,255,.25) inset;
}
#urlbar-go-button:hover {
background-image: -moz-linear-gradient(rgb(96,221,96), rgb(71,191,71) 49%, rgb(54,171,54) 51%, rgb(50,147,50));
}
#urlbar-reload-button {
-moz-image-region: rect(0px, 14px, 14px, 0px);
}
#urlbar-reload-button:hover {
-moz-image-region: rect(0px, 28px, 14px, 14px);
background-image: -moz-linear-gradient(rgb(162,207,241), rgb(111,178,225) 49%, rgb(91,159,217) 51%, rgb(62,138,200));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 1px rgba(255,255,255,.25) inset;
}
#urlbar-stop-button {
-moz-image-region: rect(0px, 42px, 14px, 28px);
background-image: -moz-linear-gradient(rgb(231,162,140), rgb(209,119,100) 49%, rgb(193,92,78) 51%, rgb(173,72,58));
-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
-1px -1px 1px rgba(255,255,255,.25) inset;
}
#urlbar-stop-button:hover {
background-image: -moz-linear-gradient(rgb(244,156,128), rgb(215,101,77) 49%, rgb(194,66,48) 51%, rgb(170,41,23));
}
#urlbar-stop-button[disabled="true"] > .toolbarbutton-icon {
opacity: .5;
}
/* star button */

View File

@ -32,6 +32,7 @@ browser.jar:
skin/classic/browser/livemark-folder.png (livemark-folder.png)
skin/classic/browser/Privacy-16.png
skin/classic/browser/Privacy-48.png
skin/classic/browser/reload-stop-go.png
skin/classic/browser/Secure.png (Secure.png)
skin/classic/browser/Secure24.png (Secure24.png)
skin/classic/browser/Security-broken.png (Security-broken.png)
@ -147,6 +148,7 @@ browser.jar:
skin/classic/aero/browser/livemark-folder.png (livemark-folder-aero.png)
skin/classic/aero/browser/Privacy-16.png (Privacy-16-aero.png)
skin/classic/aero/browser/Privacy-48.png (Privacy-48-aero.png)
skin/classic/aero/browser/reload-stop-go.png
skin/classic/aero/browser/Secure.png (Secure-aero.png)
skin/classic/aero/browser/Secure24.png (Secure24-aero.png)
skin/classic/aero/browser/Security-broken.png (Security-broken-aero.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -79,6 +79,8 @@
xbl:inherits="open,enablehistory,parentfocused=focused"/>
<xul:popupset anonid="popupset" class="autocomplete-result-popupset"/>
<children includes="toolbarbutton"/>
</content>
<implementation implements="nsIAccessibleProvider, nsIAutoCompleteInput, nsIDOMXULMenuListElement">