Index: modules/toolbar/toolbar.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.css,v
retrieving revision 1.2
diff -u -r1.2 toolbar.css
--- modules/toolbar/toolbar.css	29 Jul 2009 12:28:41 -0000	1.2
+++ modules/toolbar/toolbar.css	27 Aug 2009 10:01:13 -0000
@@ -84,7 +84,7 @@
   left: 10px;
 }
 
-div#toolbar div.toolbar-menu span.toggle {
+div#toolbar div.toolbar-menu a.toggle {
   position: absolute;
   right: 10px;
   cursor: pointer;
@@ -95,7 +95,7 @@
   height: 25px;
 }
 
-div#toolbar div.toolbar-menu span.toggle-active {
+div#toolbar div.toolbar-menu a.toggle-active {
   background-position:  -25px -60px;
 }
 
Index: modules/toolbar/toolbar.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.js,v
retrieving revision 1.1
diff -u -r1.1 toolbar.js
--- modules/toolbar/toolbar.js	4 Jul 2009 05:37:30 -0000	1.1
+++ modules/toolbar/toolbar.js	27 Aug 2009 10:01:13 -0000
@@ -14,7 +14,7 @@
     });
 
     // Toggling of admin shortcuts visibility.
-    $('#toolbar span.toggle:not(.processed)').each(function() {
+    $('#toolbar a.toggle:not(.processed)').each(function() {
       $(this).click(function() {
         Drupal.admin.toolbar.toggle();
         return false;
@@ -51,7 +51,10 @@
  */
 Drupal.admin.toolbar.collapse = function() {
   $('#toolbar div.toolbar-shortcuts').addClass('collapsed');
-  $('#toolbar span.toggle').removeClass('toggle-active');
+  $('#toolbar a.toggle')
+    .removeClass('toggle-active')
+    .attr('title', Drupal.t('Show toolbar shortcuts'))
+    .html(Drupal.t('Show toolbar shortcuts'));
   $('body').removeClass('toolbar-shortcuts');
   $.cookie(
     'Drupal.admin.toolbar.collapsed', 
@@ -65,7 +68,10 @@
  */
 Drupal.admin.toolbar.expand = function() {
   $('#toolbar div.toolbar-shortcuts').removeClass('collapsed');
-  $('#toolbar span.toggle').addClass('toggle-active');
+  $('#toolbar a.toggle')
+    .addClass('toggle-active')
+    .attr('title', Drupal.t('Hide toolbar shortcuts'))
+    .html(Drupal.t('Hide toolbar shortcuts'));;
   $('body').addClass('toolbar-shortcuts');
   $.cookie(
     'Drupal.admin.toolbar.collapsed', 
@@ -78,7 +84,7 @@
  * Toggle the admin toolbar.
  */
 Drupal.admin.toolbar.toggle = function() {
-  if ($('#toolbar div.toolbar-shortcuts').is('.collapsed')) {
+  if ($('#toolbar div.toolbar-shortcuts').hasClass('collapsed')) {
     Drupal.admin.toolbar.expand();
   }
   else {
Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.6
diff -u -r1.6 toolbar.module
--- modules/toolbar/toolbar.module	22 Aug 2009 14:34:22 -0000	1.6
+++ modules/toolbar/toolbar.module	27 Aug 2009 10:59:46 -0000
@@ -21,16 +21,82 @@
 /**
  * Implement hook_theme().
  */
-function toolbar_theme($existing, $type, $theme, $path) {
-  $items['toolbar'] = array(
-    'arguments' => array('toolbar' => array()),
-    'template' => 'toolbar',
-    'path' => drupal_get_path('module', 'toolbar'),
+function toolbar_theme() {
+  return array(
+    'toolbar' => array(
+      'arguments' => array('toolbar' => array()),
+      'template' => 'toolbar',
+      'path' => drupal_get_path('module', 'toolbar'),
+    ),
+    'toolbar_toggle' => array(
+      'arguments' => array('collapsed' => NULL, 'attributes' => array()),
+    ),
+  );
+}
+
+/**
+ * Implement hook_menu().
+ */
+function toolbar_menu() {
+  $items['toolbar/toggle'] = array(
+    'title' => 'Toggle shortcuts visibility',
+    'type' => MENU_CALLBACK,
+    'page callback' => 'toolbar_toggle_page',
+    'access arguments' => array('access toolbar'),
   );
+
   return $items;
 }
 
 /**
+ * Menu callback; toggles the visibility of the toolbar shortcuts.
+ */
+function toolbar_toggle_page() {
+  global $base_path;
+  // Toggle the value in the cookie.
+  setcookie('Drupal.admin.toolbar.collapsed', !_toolbar_is_collapsed(), NULL, $base_path);
+  // Redirect the user from where he used the toggle element.
+  drupal_goto();
+}
+
+/**
+ * Formats an element used to toggle the visibility of the shortcut links.
+ * 
+ * @param $element
+ *   An associative array containing the properties of the element.
+ *   Property used:
+ *     - #collapsed
+ *       A boolean value indicating the current state of the visibility of the
+ *       shortcut links.
+ * @return
+ *   An HTML string representing the element for toggling.
+ *
+ * @ingroup themable
+ */
+function theme_toolbar_toggle($collapsed, $attributes = array()) {
+  if ($collapsed) {
+    return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . t('Show toolbar shortcuts') . '"' .  drupal_attributes($attributes) . '>' . t('Show toolbar shortcuts') . '</a>';
+  }
+  else {
+    $attributes['class'][] = 'toggle-active';
+    return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . t('Hide toolbar shortcuts') . '"' .  drupal_attributes($attributes) . '>' . t('Hide toolbar shortcuts') . '</a>';
+  }
+}
+
+/**
+ * Determins if the shortcut links are currently collapsed, if they are not it
+ * means they are expanded.
+ * 
+ * @return
+ *   A boolean value indicating if the 
+ */
+function _toolbar_is_collapsed() {
+  // PHP converts dots into underscores in cookie names to avoid problems with
+  // its parser, so we use a converted cookie name.
+  return isset($_COOKIE['Drupal_admin_toolbar_collapsed']) ? $_COOKIE['Drupal_admin_toolbar_collapsed'] : 0;
+}
+
+/**
  * Implement hook_page_alter().
  * 
  * Add admin toolbar to the page_top region automatically.
@@ -48,7 +114,10 @@
  */
 function toolbar_preprocess_page(&$vars) {
   if (user_access('access toolbar')) {
-    $vars['classes_array'][] = 'toolbar toolbar-shortcuts';
+    $vars['classes_array'][] = 'toolbar';
+    if (!_toolbar_is_collapsed()) {
+      $vars['classes_array'][] = 'toolbar-shortcuts';
+    }
   }
 }
 
@@ -96,12 +165,23 @@
   );
 
   // Add convenience shortcut links.
+  $shortcuts_menu = menu_load('admin_shortcuts');
   $shortcuts = menu_tree_all_data('admin_shortcuts');
   $shortcuts = toolbar_menu_navigation_links($shortcuts);
   $build['toolbar_shortcuts'] = array(
     '#theme' => 'links',
     '#links' => $shortcuts,
     '#attributes' => array('id' => 'toolbar-shortcuts'),
+    '#heading' => array('text' => $shortcuts_menu['title'], 'level' => 'h2', 'class' => 'element-invisible'),
+    '#prefix' => '<div class="toolbar-shortcuts clearfix' . (_toolbar_is_collapsed() ? ' collapsed' : '') . '">',
+    '#suffix' => '</div>',
+  );
+
+  // Add an anchor to be able to toggle the visibility of the shortcut links.
+  $build['toolbar_toggle'] = array(
+    '#theme' => 'toolbar_toggle',
+    '#collapsed' => _toolbar_is_collapsed(),
+    '#attributes' => array('class' => array('toggle')),
   );
 
   return $build;
Index: modules/toolbar/toolbar.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.tpl.php,v
retrieving revision 1.2
diff -u -r1.2 toolbar.tpl.php
--- modules/toolbar/toolbar.tpl.php	29 Jul 2009 12:28:41 -0000	1.2
+++ modules/toolbar/toolbar.tpl.php	27 Aug 2009 10:01:13 -0000
@@ -16,14 +16,12 @@
 ?>
 <div id="toolbar" class="clearfix">
   <div class="toolbar-menu clearfix">
-    <span class="toggle toggle-active"><?php print t('Show shortcuts'); ?></span>
+    <?php print render($toolbar['toolbar_toggle']); ?>
     <?php print render($toolbar['toolbar_menu']); ?>
     <?php print render($toolbar['toolbar_user']); ?>
   </div>
 
-  <div class="toolbar-shortcuts clearfix">
-    <?php print render($toolbar['toolbar_shortcuts']); ?>
-  </div>
+  <?php print render($toolbar['toolbar_shortcuts']); ?>
 
   <div class="shadow"></div>
 </div>
