Bug 520913: Use CSS classes instead of manually resizing elements [r=mark.finkle]
authorBenjamin Stover <bstover@mozilla.com>
Wed, 14 Oct 2009 17:19:29 -0400
changeset 65669 2aa41ed85084737ad439403eb39b7811ce665c15
parent 65668 57329841859c0ab1ee81bd4a69e7f2bf7a59a847
child 65670 582b4809cedebbd04274d9c470e662afbc44cb2c
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs520913
Bug 520913: Use CSS classes instead of manually resizing elements [r=mark.finkle]
mobile/chrome/content/BrowserView.js
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.js
mobile/chrome/content/browser.xul
mobile/themes/hildon/browser.css
--- a/mobile/chrome/content/BrowserView.js
+++ b/mobile/chrome/content/BrowserView.js
@@ -506,22 +506,21 @@ BrowserView.prototype = {
       return;
 
     var windowUtils = browser.contentWindow
                              .QueryInterface(Ci.nsIInterfaceRequestor)
                              .getInterface(Ci.nsIDOMWindowUtils);
     var handheldFriendly = windowUtils.getDocumentMetadata("HandheldFriendly");
     
     if (handheldFriendly == "true") {
-      browser.handheld = true;
-      browser.setAttribute("style", "width: " + window.screen.width + "px;");
+      browser.className = "browser-handheld";
       this.setZoomLevel(1);
       browser.markupDocumentViewer.textZoom = 1;
     } else {
-      delete  browser.handheld;
+      browser.className = "browser";
       let [w, h] = BrowserView.Util.getBrowserDimensions(browser);
       this.setZoomLevel(BrowserView.Util.pageZoomLevel(this.getVisibleRect(), w, h));
     }
   },
 
   zoom: function zoom(aDirection) {
     let bvs = this._browserViewportState;
 
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -319,66 +319,31 @@ var BrowserUI = {
   },
   
   get starButton() {
     delete this.starButton;
     return this.starButton = document.getElementById("tool-star");
   },
 
   sizeControls : function(windowW, windowH) {
-    // tabs
-    document.getElementById("tabs").resize();
-
     // awesomebar
     let popup = document.getElementById("popup_autocomplete");
     popup.top = this.toolbarH;
     popup.height = windowH - this.toolbarH;
     popup.width = windowW;
 
-    // toolbar UI
-    document.getElementById("toolbar-container").height = this.toolbarH;
-    document.getElementById("toolbar-main").width = windowW;
-
-    // notification box
-    document.getElementById("notifications").width = windowW;
-
-    // findbar
-    document.getElementById("findbar-container").width = windowW;
-
-    // identity
-    document.getElementById("identity-container").width = windowW;
-
-    // bookmark editor
-    let bmkeditor = document.getElementById("bookmark-container");
-    bmkeditor.width = windowW;
-
-    // bookmark list
-    let bookmarks = document.getElementById("bookmarklist-container");
-    bookmarks.height = windowH;
-    bookmarks.width = windowW;
-    
     // bookmark popup
     let bookmarkPopup = document.getElementById("bookmark-popup");
     let bookmarkPopupW = windowW / 4;
     bookmarkPopup.height = windowH / 4;
     bookmarkPopup.width = bookmarkPopupW;
     let starRect = this.starButton.getBoundingClientRect();
     const popupMargin = 10;
     bookmarkPopup.top = Math.round(starRect.top) + popupMargin;
     bookmarkPopup.left = windowW - this.sidebarW - bookmarkPopupW - popupMargin;
-
-    // select list UI
-    let selectlist = document.getElementById("select-container");
-    selectlist.height = windowH;
-    selectlist.width = windowW;
-
-    // tools panel
-    let panel = document.getElementById("panel-container");
-    panel.height = windowH;
-    panel.width = windowW;
   },
 
   init : function() {
     this._edit = document.getElementById("urlbar-edit");
     this._throbber = document.getElementById("urlbar-throbber");
     this._favicon = document.getElementById("urlbar-favicon");
     this._favicon.addEventListener("error", this, false);
 
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -335,92 +335,85 @@ var Browser = {
   _tabs : [],
   _selectedTab : null,
   windowUtils: window.QueryInterface(Ci.nsIInterfaceRequestor)
                      .getInterface(Ci.nsIDOMWindowUtils),
   contentScrollbox: null,
   contentScrollboxScroller: null,
   controlsScrollbox: null,
   controlsScrollboxScroller: null,
+  styles: {},
 
   startup: function() {
     var self = this;
 
     //dump("begin startup\n");
 
     let container = document.getElementById("tile-container");
     let bv = this._browserView = new BrowserView(container, Browser.getVisibleRect);
 
     /* handles dispatching clicks on tiles into clicks in content or zooms */
     container.customClicker = new ContentCustomClicker(bv);
 
-    /* vertically scrolling box that contains tiles and the urlbar */
+    /* scrolling box that contains tiles */
     let contentScrollbox = this.contentScrollbox = document.getElementById("tile-container-container");
     this.contentScrollboxScroller = contentScrollbox.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
     contentScrollbox.customDragger = new Browser.MainDragger(bv);
 
     /* horizontally scrolling box that holds the sidebars as well as the contentScrollbox */
-    let controlsScrollbox = this.controlsScrollbox = document.getElementById("scrollbox");
+    let controlsScrollbox = this.controlsScrollbox = document.getElementById("controls-scrollbox");
     this.controlsScrollboxScroller = controlsScrollbox.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
     controlsScrollbox.customDragger = {
       dragStart: function dragStart(cx, cy, target, scroller) {},
       dragStop: function dragStop(dx, dy, scroller) { return false; },
       dragMove: function dragMove(dx, dy, scroller) { return false; }
     };
 
     // during startup a lot of viewportHandler calls happen due to content and window resizes
     bv.beginBatchOperation();
 
+    let stylesheet = document.styleSheets[0];
+    for each (let style in ['window-width', 'window-height', 'toolbar-height', 'browser', 'browser-handheld']) {
+      let index = stylesheet.insertRule("." + style + " {}", stylesheet.cssRules.length);
+      this.styles[style] = stylesheet.cssRules[index].style;
+    }
+
     function resizeHandler(e) {
 
       if (e.target != window)
         return;
 
-      //dump(window.innerWidth + "," + window.innerHeight + "\n");
       // XXX is this code right here actually needed?
       let w = window.innerWidth;
       let h = window.innerHeight;
       let maximize = (document.documentElement.getAttribute("sizemode") == "maximized");
       if (maximize && w > screen.width)
         return;
 
       bv.beginBatchOperation();
 
-      contentScrollbox.style.width  = w + 'px';
-      contentScrollbox.style.height = h + 'px';
-
-      controlsScrollbox.style.width  = w + 'px';
-      controlsScrollbox.style.height = h + 'px';
-
       let toolbarHeight = Math.round(document.getElementById("toolbar-main").getBoundingClientRect().height);
-      let spacers = document.getElementsByClassName("sidebar-spacer");
-      for (let i = 0, len = spacers.length; i < len; i++) spacers[i].style.height = toolbarHeight + 'px';
-
-      // toolbar UI
-      document.getElementById("toolbar-main").width = w;
+      let scaledDefaultH = (kDefaultBrowserWidth * (h / w));
+      let scaledScreenH = (window.screen.width * (h / w));
+
+      Browser.styles["window-width"].width = w + "px";
+      Browser.styles["window-height"].height = h + "px";
+      Browser.styles["toolbar-height"].height = toolbarHeight + "px";
+      Browser.styles["browser"].width = kDefaultBrowserWidth + "px";
+      Browser.styles["browser"].height = scaledDefaultH + "px";
+      Browser.styles["browser-handheld"].width = window.screen.width + "px";
+      Browser.styles["browser-handheld"].height = scaledScreenH + "px";
 
       // Tell the UI to resize the browser controls before calling  updateSize
       BrowserUI.sizeControls(w, h);
 
-      // Resize the browsers...
-      let browsers = Browser.browsers;
-      if (browsers) {
-        let scaledDefaultH = (kDefaultBrowserWidth * (h / w));
-        let scaledScreenH = (window.screen.width * (h / w));
-        for (let i=0; i<browsers.length; i++) {
-          let browserStyle = browsers[i].style;
-          browserStyle.height = ((browsers[i].hasOwnProperty("handheld") && 
-                                  browsers[i].handheld) ? 
-                                 scaledScreenH : scaledDefaultH) + "px";
-        }
-      }
-
       bv.zoomToPage();
       Browser.hideSidebars();
       // hidesidebars calls bv.onAfterVisibleMove();
+
       bv.commitBatchOperation();
     }
     window.addEventListener("resize", resizeHandler, false);
 
     function fullscreenHandler() {
       if (!window.fullScreen)
         document.getElementById("toolbar-main").setAttribute("fullscreen", "true");
       else
@@ -2169,17 +2162,17 @@ var HelperAppDialog = {
       document.getElementById("helperapp-open").disabled = true;
 
     let toolbar = document.getElementById("toolbar-main");
     let top = toolbar.top + toolbar.boxObject.height;
     let container = document.getElementById("helperapp-container");
     container.hidden = false;
 
     let rect = container.getBoundingClientRect();
-    container.top = top < 0 ? 0 : top;
+    container.top = Math.max(0, top);
     container.left = (window.innerWidth - rect.width) / 2;
   },
 
   save: function had_save() {
     this._launcher.saveToDisk(null, false);
     this.close();
   },
 
@@ -2536,20 +2529,20 @@ Tab.prototype = {
     }
   },
 
   _createBrowser: function() {
     if (this._browser)
       throw "Browser already exists";
 
     // Create the browser using the current width the dynamically size the height
-    let scaledHeight = kDefaultBrowserWidth * (window.innerHeight / window.innerWidth);
     let browser = this._browser = document.createElement("browser");
 
-    browser.setAttribute("style", "overflow: -moz-hidden-unscrollable; visibility: hidden; width: " + kDefaultBrowserWidth + "px; height: " + scaledHeight + "px;");
+    browser.className = "browser";
+    browser.setAttribute("style", "overflow: -moz-hidden-unscrollable; visibility: hidden;");
     browser.setAttribute("type", "content");
 
     // Append the browser to the document, which should start the page load
     document.getElementById("browsers").appendChild(browser);
 
     // stop about:blank from loading
     browser.stop();
 
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -175,103 +175,97 @@
     <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
     <key keycode="&findAgainCmd.commandkey2;"  command="cmd_findPrevious" modifiers="shift"/>
   </keyset>
 
   <popupset id="mainPopupSet">
   </popupset>
 
   <stack flex="1" id="stack">
-    <scrollbox id="scrollbox" style="overflow: hidden;" top="0" left="0" flex="1">
-      <hbox style="position: relative">
-
-        <vbox>
-          <spacer class="sidebar-spacer"/>
-          <!-- Left toolbar -->
-          <vbox id="tabs-container" class="panel-dark" flex="1">
-            <vbox id="tabs" onselect="BrowserUI.selectTab(this);" onclosetab="BrowserUI.closeTab(this)" flex="1"/>
-            <hbox id="tabs-controls">
-              <toolbarbutton id="newtab-button" class="button-image" command="cmd_newTab"/>
-            </hbox>
-          </vbox>
+    <scrollbox id="controls-scrollbox" style="overflow: hidden; -moz-box-orient: horizontal; position: relative;" flex="1">
+      <vbox class="panel-dark">
+        <spacer class="toolbar-height"/>
+        <!-- Left toolbar -->
+        <vbox id="tabs-container" class="panel-dark" flex="1">
+          <vbox id="tabs" onselect="BrowserUI.selectTab(this);" onclosetab="BrowserUI.closeTab(this)" flex="1"/>
+          <hbox id="tabs-controls">
+            <toolbarbutton id="newtab-button" class="button-image" command="cmd_newTab"/>
+          </hbox>
         </vbox>
+      </vbox>
 
-        <!-- Content Area -->
-        <scrollbox id="tile-container-container" style="-moz-box-orient: vertical; overflow: hidden;" flex="1">
-
-          <!-- Main Toolbar -->
-          <box id="toolbar-container" class="panel-dark">
-            <box id="toolbar-moveable-container">
-              <toolbar id="toolbar-main" class="panel-dark">
+      <!-- Content Area -->
+      <scrollbox id="tile-container-container" style="overflow: hidden; -moz-box-orient: vertical;">
+        <!-- Main Toolbar -->
+        <box id="toolbar-container" class="panel-dark toolbar-height">
+          <box id="toolbar-moveable-container">
+            <toolbar id="toolbar-main" class="panel-dark window-width">
 #ifdef MOZ_PLATFORM_HILDON
-                <toolbarbutton id="tool-app-switch" class="button-image" oncommand="BrowserUI.switchTask();"/>
+              <toolbarbutton id="tool-app-switch" class="button-image" oncommand="BrowserUI.switchTask();"/>
 #endif
-                <hbox id="urlbar-container" flex="1">
-                  <box id="identity-box"
-                       onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
-                       onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
-                    <box id="urlbar-image-box">
-                      <image id="urlbar-throbber"/>
-                      <image id="urlbar-favicon" hidden="true"/>
-                    </box>
+              <hbox id="urlbar-container" flex="1">
+                <box id="identity-box"
+                     onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
+                     onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
+                  <box id="urlbar-image-box">
+                    <image id="urlbar-throbber"/>
+                    <image id="urlbar-favicon" hidden="true"/>
                   </box>
-                  <hbox id="urlbar-editarea" flex="1">
-                    <textbox id="urlbar-edit"
-                             type="autocomplete"
-                             autocompletesearch="history"
-                             autocompletepopup="popup_autocomplete"
-                             enablehistory="false"
-                             maxrows="6"
-                             completeselectedindex="true"
-                             minresultsforpopup="0"
-                             flex="1"
-                             ontextentered="BrowserUI.goToURI();"
-                             clickSelectsAll="true"/>
-                  </hbox>
-                  <hbox id="urlbar-icons" mode="view">
-                    <toolbarbutton id="tool-reload" class="urlbar-cap-button" command="cmd_reload"/>
-                    <toolbarbutton id="tool-stop" class="urlbar-cap-button" command="cmd_stop"/>
-                    <toolbarbutton id="tool-go" class="urlbar-cap-button" command="cmd_go"/>
-                  </hbox>
+                </box>
+                <hbox id="urlbar-editarea" flex="1">
+                  <textbox id="urlbar-edit"
+                           type="autocomplete"
+                           autocompletesearch="history"
+                           autocompletepopup="popup_autocomplete"
+                           enablehistory="false"
+                           maxrows="6"
+                           completeselectedindex="true"
+                           minresultsforpopup="0"
+                           flex="1"
+                           ontextentered="BrowserUI.goToURI();"
+                           clickSelectsAll="true"/>
                 </hbox>
-                <toolbarbutton id="tool-app-close" class="urlbar-button button-image" command="cmd_close"/>
-              </toolbar>
-            </box>
+                <hbox id="urlbar-icons" mode="view">
+                  <toolbarbutton id="tool-reload" class="urlbar-cap-button" command="cmd_reload"/>
+                  <toolbarbutton id="tool-stop" class="urlbar-cap-button" command="cmd_stop"/>
+                  <toolbarbutton id="tool-go" class="urlbar-cap-button" command="cmd_go"/>
+                </hbox>
+              </hbox>
+              <toolbarbutton id="tool-app-close" class="urlbar-button button-image" command="cmd_close"/>
+            </toolbar>
           </box>
+        </box>
 
-          <notificationbox id="notifications"/>
+        <notificationbox id="notifications"/>
 
-          <!-- Content viewport -->
-          <box>
-            <html:div id="tile-container" style="width: 800px; height: 480px; overflow: hidden;"/>
-          </box>
-        </scrollbox>
+        <!-- Content viewport -->
+        <html:div id="tile-container" class="window-height" style="overflow: hidden;"/>
+      </scrollbox>
 
-        <!-- Right toolbar -->
-        <vbox>
-          <spacer class="sidebar-spacer"/>
+      <!-- Right toolbar -->
+      <vbox class="panel-dark">
+        <spacer class="toolbar-height"/>
 
-          <vbox id="browser-controls" style="overflow: -moz-hidden-unscrollable;" class="panel-dark" flex="1">
-            <toolbarbutton id="tool-star" class="browser-control-button button-image" command="cmd_star"/>
-            <toolbarbutton id="tool-back" class="browser-control-button button-image" command="cmd_back"/>
-            <toolbarbutton id="tool-forward" class="browser-control-button button-image" command="cmd_forward"/>
-            <toolbarspring/>
-            <toolbarbutton id="tool-panel-open" class="page-button button-image" command="cmd_panel"/>
-          </vbox>
+        <vbox id="browser-controls" style="overflow: -moz-hidden-unscrollable;" class="panel-dark" flex="1">
+          <toolbarbutton id="tool-star" class="browser-control-button button-image" command="cmd_star"/>
+          <toolbarbutton id="tool-back" class="browser-control-button button-image" command="cmd_back"/>
+          <toolbarbutton id="tool-forward" class="browser-control-button button-image" command="cmd_forward"/>
+          <toolbarspring/>
+          <toolbarbutton id="tool-panel-open" class="page-button button-image" command="cmd_panel"/>
         </vbox>
-      </hbox>
+      </vbox>
     </scrollbox>
 
     <!-- popup for find toolbar -->
-    <hbox id="findbar-container" hidden="true" top="0" left="0">
+    <hbox id="findbar-container" hidden="true" class="window-width">
       <findbar id="findbar" flex="1"/>
     </hbox>
 
     <!-- popup for site identity information -->
-    <vbox id="identity-container" hidden="true" class="panel-dark" top="0" left="0" mode="unknownIdentity">
+    <vbox id="identity-container" hidden="true" class="panel-dark window-width" mode="unknownIdentity">
       <hbox id="identity-popup-container" flex="1" align="top">
         <image id="identity-popup-icon"/>
         <vbox id="identity-popup-content-box" flex="1">
           <hbox flex="1">
             <label id="identity-popup-connectedToLabel" value="&identity.connectedTo2;"/>
             <label id="identity-popup-connectedToLabel2" flex="1">&identity.unverifiedsite2;</label>
             <description id="identity-popup-content-host" flex="1"/>
           </hbox>
@@ -300,23 +294,23 @@
     <vbox id="bookmark-popup" hidden="true" class="panel-dark" oncommand="BookmarkPopup.hide()" align="center">
       <label value="&bookmarkPopup.label;"/>
       <vbox>
         <button label="&bookmarkEdit.label;" oncommand="BookmarkHelper.edit(); BrowserUI.hideControls();"/>
         <button label="&bookmarkRemove.label;" oncommand="removeBookmarksForURI(getBrowser().currentURI);"/>
       </vbox>
     </vbox>
 
-    <vbox id="bookmark-container" hidden="true" class="panel-dark" top="0" left="0">
+    <vbox id="bookmark-container" hidden="true" class="panel-dark window-width">
       <hbox id="bookmark-form" align="start">
         <image id="bookmark-image" src="chrome://browser/skin/images/starred-default-64.png"/>
       </hbox>
     </vbox>
 
-    <box id="panel-container" hidden="true" class="panel-dark" top="0" left="0">
+    <box id="panel-container" hidden="true" class="panel-dark">
       <box id="panel-controls" oncommand="BrowserUI.switchPane(event.target.getAttribute('linkedpanel'));">
         <toolbarbutton id="tool-panel-close" class="page-button button-image" command="cmd_panel"/>
         <toolbarbutton id="tool-addons" type="radio" group="1" class="panel-button button-image" linkedpanel="addons-container"/>
         <toolbarbutton id="tool-downloads" type="radio" group="1" class="panel-button button-image" linkedpanel="downloads-container"/>
         <toolbarbutton id="tool-preferences" type="radio" group="1" checked="true" class="panel-button button-image" linkedpanel="prefs-container"/>
         <toolbarbutton id="tool-console" type="radio" group="1" hidden="true" class="panel-button button-image" linkedpanel="console-container"/>
       </box>
       <deck id="panel-items" selectedIndex="2" flex="1">
@@ -415,58 +409,63 @@
             </hbox>
           </vbox>
 
           <richlistbox id="console-box" class="console-box" flex="1"/>
         </vbox>
       </deck>
     </box>
 
-    <vbox id="popup_autocomplete" class="panel-dark" hidden="true" top="0" left="0">
+    <!-- titlebar autocomplete results -->
+    <vbox id="popup_autocomplete" class="panel-dark" hidden="true">
       <arrowscrollbox id="autocomplete_navbuttons"
                       align="center"
                       flex="1"
                       orient="horizontal">
         <image class="tool-search"/>
         <radiogroup id="search-buttons" class="toggle-dark" onclick="BrowserUI.doButtonSearch(event.target);">
         </radiogroup>
       </arrowscrollbox>
     </vbox>
 
-    <vbox id="select-container" hidden="true" top="0" left="0">
+    <!-- options dialog for select form field -->
+    <vbox id="select-container" hidden="true">
       <vbox id="select-container-inner" class="panel-dark" flex="1">
         <scrollbox id="select-list" flex="1" orient="vertical"/>
         <hbox id="select-buttons">
           <button class="button-dark" label="&selectListDone.label;" oncommand="SelectHelper.close();"/>
         </hbox>
       </vbox>
     </vbox>
 
-    <vbox id="bookmarklist-container" class="panel-dark" hidden="true" top="0" left="0">
+    <!-- bookmark window -->
+    <vbox id="bookmarklist-container" class="panel-dark" hidden="true">
       <hbox id="bookmarklist-header">
         <description flex="1">&bookmarksHeader.label;</description>
         <toolbarbutton id="tool-bookmarks-manage" class="urlbar-button show-text button-dark" type="checkbox" autocheck="true"
                        label="&bookmarksManage.label;" oncommand="BookmarkList.toggleManage();"/>
         <toolbarbutton id="tool-bookmarks-close" class="urlbar-button button-image" command="cmd_close"/>
       </hbox>
       <placelist id="bookmark-items" type="bookmarks" flex="1" onopen="BookmarkList.openBookmark();"/>
     </vbox>
 
-    <vbox id="helperapp-container" class="dialog-dark" hidden="true" align="center" top="0" left="0">
+    <!-- save/open dialog -->
+    <vbox id="helperapp-container" class="dialog-dark" hidden="true" align="center" top="0">
       <label id="helperapp-prompt" value="&helperApp.prompt;"/>
       <label id="helperapp-target" value="" crop="center"/>
       <separator/>
       <hbox pack="center">
         <button id="helperapp-open" class="button-dark" label="&helperApp.open;" oncommand="HelperAppDialog.open();"/>
         <button id="helperapp-save" class="button-dark" label="&helperApp.save;" oncommand="HelperAppDialog.save();"/>
         <button id="helperapp-nothing" class="button-dark" label="&helperApp.nothing;" oncommand="HelperAppDialog.close();"/>
       </hbox>
     </vbox>
 
-    <hbox id="alerts-container" hidden="true" align="start" top="0" left="0" width="200"
+    <!-- alerts for content -->
+    <hbox id="alerts-container" hidden="true" align="start" width="200"
           onclick="AlertsHelper.click(event);">
       <image id="alerts-image"/>
       <vbox flex="1">
         <label id="alerts-title" value=""/>
         <description id="alerts-text" flex="1"/>
       </vbox>
     </hbox>
   </stack>
--- a/mobile/themes/hildon/browser.css
+++ b/mobile/themes/hildon/browser.css
@@ -43,20 +43,16 @@
 /* main toolbar (URL bar) -------------------------------------------------- */
 #toolbar-main {
   -moz-appearance: none;
   -moz-box-align: center;
   padding: 0.5mm 1mm; /* half core spacing & core spacing */
   border: none;
 }
 
-#toolbar-moveable-container {
-  display: block;
-}
-
 #toolbar-moveable-container[top="0"] {
   position: fixed;
   left: 0;
   z-index: 1000;
 }
 
 
 /* main toolbar buttons */