* hildon-widgets/hildon-app.c (hildon_app_key_snooper): Add code to control if there...
authorLuc Pionchon <luc.pionchon@nokia.com>
Sun, 28 May 2006 22:44:01 +0000 (22:44 +0000)
committerLuc Pionchon <luc.pionchon@nokia.com>
Sun, 28 May 2006 22:44:01 +0000 (22:44 +0000)
NB#26383

ChangeLog
hildon-widgets/hildon-app.c

index a69f9b6..431f99b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-05-29  Luc Pionchon  <luc.pionchon@nokia.com>
 
+       * hildon-widgets/hildon-app.c
+       (hildon_app_key_snooper): Add code to control if there is a
+       combobox activated when the menu key is pressed and prevent the
+       menu drawing.
+
+       NB#26383
+
+
+2006-05-29  Luc Pionchon  <luc.pionchon@nokia.com>
+
        * hildon-widgets/hildon-banner.c
        (hildon_banner_set_property): Set max_width hint to -1 instead of
        HILDON_BANNER_LABEL_MAX_TIMED when banner is timed to avoid. This
index a35a332..d504d69 100644 (file)
@@ -51,6 +51,8 @@
 #include <gtk/gtkuimanager.h>
 #include <gtk/gtkactiongroup.h>
 #include <gtk/gtkdialog.h>
+#include <gtk/gtktogglebutton.h>
+#include <gtk/gtkcombobox.h>
 
 #include <libintl.h>
 #include <string.h>
@@ -1501,10 +1503,28 @@ hildon_app_key_snooper (GtkWidget *widget, GdkEventKey *keyevent, HildonApp *app
     if ( HILDON_KEYEVENT_IS_MENU_KEY (keyevent) ) {
            HildonAppView *appview;
            HildonAppPrivate *priv;
-                 GtkWidget *toplevel;
-                 
+            GtkWidget *toplevel;
+            GtkWidget *focus = NULL;
+
       /* Don't act on modal dialogs */
       toplevel = gtk_widget_get_toplevel (widget);
+      focus = gtk_window_get_focus(GTK_WINDOW(app));
+
+      /* Don't act when comboboxes are active, if a togglebutton
+         (combobox) has the focus and it is active, we deactivate the
+         combobox and do nothing */ 
+      if (GTK_IS_TOGGLE_BUTTON (focus))
+        {
+          GtkWidget *parent = gtk_widget_get_parent (focus);
+          
+          if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (focus)) && 
+              GTK_IS_COMBO_BOX (parent)) 
+            {
+              gtk_combo_box_popdown (GTK_COMBO_BOX (parent));
+              return TRUE;
+            }
+        }
+
       if (GTK_IS_DIALOG (toplevel)
           && gtk_window_get_modal (GTK_WINDOW (toplevel)))
         {