Bug 733292 - The sidebar should have a close button. r=paul r=dao
authorAishwarya <aiishwarya.sivaraman@gmail.com>
Wed, 19 Sep 2012 16:43:26 +0200
changeset 107483 43f5c824aa3dcd0f4633afb0370099495c004f66
parent 107482 90cc14017766749cf5635c9a2c244d8d75902020
child 107484 47e7a44f9c9123cad29e0d63398ec08504e97071
push id23489
push userttaubert@mozilla.com
push dateThu, 20 Sep 2012 09:37:23 +0000
treeherdermozilla-central@2208b83cc81d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul, dao
bugs733292
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 733292 - The sidebar should have a close button. r=paul r=dao
browser/base/content/browser.xul
browser/devtools/highlighter/inspector.jsm
browser/locales/en-US/chrome/browser/browser.dtd
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -1062,17 +1062,22 @@
       <chatbar id="pinnedchats" layer="true" mousethrough="always"/>
       <statuspanel id="statusbar-display" inactive="true"/>
     </vbox>
     <splitter id="devtools-side-splitter" hidden="true"/>
     <vbox id="devtools-sidebar-box" hidden="true"
           style="min-width: 18em; width: 22em; max-width: 42em;" persist="width">
       <toolbar id="devtools-sidebar-toolbar"
                class="devtools-toolbar"
-               nowindowdrag="true"/>
+               nowindowdrag="true">
+        <spacer flex="1"/>
+        <toolbarbutton tooltiptext="&inspectSidebarCloseButton.tooltiptext;"
+                       class="devtools-closebutton"
+                       command="Inspector:Sidebar"/>
+      </toolbar>
       <deck id="devtools-sidebar-deck" flex="1"/>
     </vbox>
     <splitter id="social-sidebar-splitter"
               class="chromeclass-extrachrome sidebar-splitter"
               observes="socialSidebarBroadcaster"/>
     <vbox id="social-sidebar-box"
           class="chromeclass-extrachrome"
           observes="socialSidebarBroadcaster">
--- a/browser/devtools/highlighter/inspector.jsm
+++ b/browser/devtools/highlighter/inspector.jsm
@@ -1642,18 +1642,19 @@ InspectorStyleSidebar.prototype = {
     let btn = this._chromeDoc.createElement("toolbarbutton");
     btn.setAttribute("label", aRegObj.label);
     btn.setAttribute("class", "devtools-toolbarbutton");
     btn.setAttribute("tooltiptext", aRegObj.tooltiptext);
     btn.setAttribute("accesskey", aRegObj.accesskey);
     btn.setAttribute("image", aRegObj.icon || "");
     btn.setAttribute("type", "radio");
     btn.setAttribute("group", "sidebar-tools");
-    this._toolbar.appendChild(btn);
 
+    let spacer = this._toolbar.querySelector("spacer");
+    this._toolbar.insertBefore(btn, spacer);
     // create tool iframe
     let frame = this._chromeDoc.createElement("iframe");
     frame.setAttribute("flex", "1");
     frame._toolID = aRegObj.id;
 
     // This is needed to enable tooltips inside the iframe document.
     frame.setAttribute("tooltip", "aHTMLTooltip");
 
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -230,16 +230,17 @@ These should match what Safari and other
   -  approximation to it or choose a word (or words) that means
   -  "simple discardable text editor". -->
 <!ENTITY scratchpad.label             "Scratchpad">
 <!ENTITY scratchpad.accesskey         "s">
 <!ENTITY scratchpad.keycode           "VK_F4">
 <!ENTITY scratchpad.keytext           "F4">
 
 <!ENTITY inspectCloseButton.tooltiptext "Close Inspector">
+<!ENTITY inspectSidebarCloseButton.tooltiptext "Close sidebar">
 
 <!ENTITY devToolbarCloseButton.tooltiptext "Close Developer Toolbar">
 <!ENTITY devToolbarMenu.label              "Developer Toolbar">
 <!ENTITY devToolbarMenu.accesskey          "v">
 <!ENTITY devToolbar.keycode                "VK_F2">
 <!ENTITY devToolbar.keytext                "F2">
 <!ENTITY devToolbarOtherToolsButton.label  "More Tools">