 css/edit.css |   66 +++++++---------------------------------------------------
 edit.module  |   62 ++++++++++++++++++++++++++----------------------------
 2 files changed, 38 insertions(+), 90 deletions(-)

diff --git a/css/edit.css b/css/edit.css
index 9109d62..0d8c6b3 100644
--- a/css/edit.css
+++ b/css/edit.css
@@ -62,67 +62,17 @@
 
 
 /**
- * Edit's bar — inspired by core's toolbar.module & shortcut.module.
+ * Toolbar.
  */
-#editbar,
-#editbar * {
-  border: 0;
-  font-size: 100%;
-  line-height: inherit;
-  list-style: none;
-  margin: 0;
-  outline: 0;
-  padding: 0;
-  text-align: left; /* LTR */
-  vertical-align: baseline;
-}
-#editbar {
-  position: relative;
-  background: #666;
-  color: #ccc;
-  font: normal small "Lucida Grande", Verdana, sans-serif;
-  margin: 0 -20px;
-  padding: 0 20px;
-  -moz-box-shadow: 0 3px 20px #000;
-  -webkit-box-shadow: 0 3px 20px #000;
-  box-shadow: 0 3px 20px #000;
-  z-index: 500;
-}
-#editbar ul {
-  padding: 5px 0 2px 0;
-  height: 28px;
-  line-height: 24px;
-  margin-left:5px; /* LTR */
-}
-#editbar ul li,
-#editbar ul li a {
-  float: left; /* LTR */
-  padding: 0 5px 0 5px;
-  margin-right: 5px; /* LTR */
-  -moz-border-radius: 5px;
-  -webkit-border-radius: 5px;
-  border-radius: 5px;
-}
-#editbar a {
-  padding: 5px 10px 5px 5px;
-  line-height: 24px;
-  color: #fefefe;
-  font-size: .846em;
-  text-decoration: none;
-}
-#editbar a:focus,
-#editbar a:hover,
-#editbar a.active {
-  color: #fff;
+.icon-edit:before {
+  background-image: url("../images/icon-edit.png");
 }
-#editbar ul li a:focus,
-#editbar ul li a:hover,
-#editbar ul li a.active:focus {
-  background: #555;
+.icon-edit:active:before,
+.active .icon-edit:before {
+  background-image: url("../images/icon-edit-active.png");
 }
-#editbar ul li a.active:hover,
-#editbar ul li a.active {
-  background: #000;
+.toolbar .tray.edit.active {
+  z-index: 300;
 }
 
 
diff --git a/edit.module b/edit.module
index 1d0c70c..6f71fdd 100644
--- a/edit.module
+++ b/edit.module
@@ -51,46 +51,47 @@ function edit_menu() {
 }
 
 /**
- * Implements hook_page_alter().
+ * Implements hook_toolbar().
  */
-function edit_page_alter(&$page) {
+function edit_toolbar() {
   if (path_is_admin(current_path())) {
     return;
   }
 
-  $page['page_top']['edit'] = array(
-    'view_edit_toggle' => array(
-      '#prefix' => '<div id="editbar"><h2 class="element-invisible">' . t('In-place edit operations') . '</h2><ul id="edit_view-edit-toggles">',
-      '#suffix' => '</ul></div>',
-      'content' => array(
-        array(
-          '#theme' => 'menu_local_task',
-          '#link' => array('title' => t('View'), 'href' => current_path(), 'localized_options' => array('fragment' => 'view', 'attributes' => array('class' => array('edit_view-edit-toggle', 'edit-view')))),
-          '#active' => TRUE,
-        ),
-        array(
-          '#theme' => 'menu_local_task',
-          '#link' => array('title' => t('Quick edit'), 'href' => current_path(), 'localized_options' => array('fragment' => 'quick-edit', 'attributes' => array('class' => array('edit_view-edit-toggle', 'edit-edit')))),
-        ),
+  $tab['edit'] = array(
+    'tab' => array(
+      'title' => t('Edit'),
+      'href' => '',
+      'html' => FALSE,
+      'attributes' => array(
+        'class' => array('icon', 'icon-edit',),
       ),
-      '#attached' => array(
-        'library' => array(
-          array('edit', 'edit'),
+    ),
+    'tray' => array(
+      'view_edit_toggle' => array(
+        '#prefix' => '<h2 class="element-invisible">' . t('In-place edit operations') . '</h2><ul id="edit_view-edit-toggles" class="menu">',
+        '#suffix' => '</ul>',
+        'content' => array(
+          array(
+            '#theme' => 'menu_local_task',
+            '#link' => array('title' => t('View'), 'href' => current_path(), 'localized_options' => array('fragment' => 'view', 'attributes' => array('class' => array('edit_view-edit-toggle', 'edit-view')))),
+            '#active' => TRUE,
+          ),
+          array(
+            '#theme' => 'menu_local_task',
+            '#link' => array('title' => t('Quick edit'), 'href' => current_path(), 'localized_options' => array('fragment' => 'quick-edit', 'attributes' => array('class' => array('edit_view-edit-toggle', 'edit-edit')))),
+          ),
+        ),
+        '#attached' => array(
+          'library' => array(
+            array('edit', 'edit'),
+          ),
         ),
       ),
     ),
-    '#post_render' => array(
-      'edit_editbar_post_render',
-    ),
   );
-}
 
-/**
- * Post-render function to remove the editbar if nothing editable is present.
- */
-function edit_editbar_post_render($html) {
-  global $editbar;
-  return ($editbar !== TRUE) ? '' : $html;
+  return $tab;
 }
 
 /**
@@ -217,9 +218,6 @@ function edit_preprocess_field(&$variables) {
   $field_access = field_access('edit', $name, $entity->entityType(), $entity);
   $editability = _edit_analyze_field_editability($field, $instance_info, $formatter_type);
   if ($entity_access && $field_access && $editability != 'disabled') {
-    global $editbar;
-    $editbar = TRUE;
-
     // Mark this field as editable and provide metadata through data- attributes.
     $variables['attributes']['data-edit-field-label'] = $instance_info->definition['label'];
     $variables['attributes']['data-edit-id'] = $entity->entityType() . ':' . $entity->id() . ':' . $name . ':' . $langcode . ':' . $view_mode;
