[maemo-commits] [maemo-commits] r13807 - in projects/haf/trunk/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Sep 13 18:05:20 EEST 2007
Author: lucasr
Date: 2007-09-13 18:05:18 +0300 (Thu, 13 Sep 2007)
New Revision: 13807

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c
Log:
2007-09-13  Lucas Rocha  <lucas.rocha at nokia.com>

	* src/hd-switcher-menu.c (hd_switcher_menu_popup_window_keypress_cb,
	hd_switcher_menu_popup_window_pane_keypress_cb): fixed keyboard
	navigation between application and notification panes. 


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-13 14:50:59 UTC (rev 13806)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-13 15:05:18 UTC (rev 13807)
@@ -1,3 +1,9 @@
+2007-09-13  Lucas Rocha  <lucas.rocha at nokia.com>
+
+	* src/hd-switcher-menu.c (hd_switcher_menu_popup_window_keypress_cb,
+	hd_switcher_menu_popup_window_pane_keypress_cb): fixed keyboard
+	navigation between application and notification panes. 
+
 2007-09-13 Johan Bilien  <johan.bilien at nokia.com>
 
 	* libhildondesktop/hildon-desktop-home-item.c: Added safegard

Modified: projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c	2007-09-13 14:50:59 UTC (rev 13806)
+++ projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c	2007-09-13 15:05:18 UTC (rev 13807)
@@ -414,15 +414,23 @@
        (switcher->priv->menu_notifications);
 
     if (notifications)    
-    {	  
+    {
+      GtkMenuItem *selected_item;
+      GList *last = g_list_last (notifications);
+	    
       hildon_desktop_popup_window_jump_to_pane 
         (switcher->priv->popup_window, 0);	    
 
-      hildon_desktop_popup_menu_select_item
-        (switcher->priv->menu_applications, NULL);
+      selected_item =
+        hildon_desktop_popup_menu_get_selected_item (
+ 	  	                     switcher->priv->menu_applications);
+     
+      hildon_desktop_popup_menu_deselect_item
+        (switcher->priv->menu_applications, selected_item);
 
-      hildon_desktop_popup_menu_select_first_item 
-        (switcher->priv->menu_notifications);	    
+      hildon_desktop_popup_menu_select_item 
+        (switcher->priv->menu_notifications,
+	 GTK_MENU_ITEM (last->data));
 
       g_list_free (notifications);
       
@@ -457,15 +465,28 @@
 
   if (cancel_menu)
   {
+    GtkMenuItem *selected_item;
+    GList *applications, *last;
+
+    applications = 
+      hildon_desktop_popup_menu_get_children (switcher->priv->menu_applications);
+
+    last = g_list_last (applications);
+    
     hildon_desktop_popup_window_jump_to_pane
       (switcher->priv->popup_window, -1);
 
+    selected_item =
+      hildon_desktop_popup_menu_get_selected_item (
+		                   switcher->priv->menu_notifications);
+    
+    hildon_desktop_popup_menu_deselect_item
+      (switcher->priv->menu_notifications, selected_item);
+
     hildon_desktop_popup_menu_select_item
-      (switcher->priv->menu_notifications, NULL);
+      (switcher->priv->menu_applications,
+       GTK_MENU_ITEM (last->data));
 
-    hildon_desktop_popup_menu_select_first_item
-      (switcher->priv->menu_applications);
-
     return TRUE;
   } 
 


More information about the maemo-commits mailing list