2006-09-14 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 14 Sep 2006 09:09:33 +0000 (09:09 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 14 Sep 2006 09:09:33 +0000 (09:09 +0000)
* hildon-widgets/hildon-composite-widget.c: Changed the focus
handler -- with hildon-time-editor and hildon-date-editor, if we
are moving up or down, with the focus inside the widget, we return
false to force moving to the next widget outside. Fixes #NB36938.

ChangeLog
hildon-widgets/hildon-composite-widget.c

index 22f80c0..7415fe5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-09-14  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * hildon-widgets/hildon-composite-widget.c: Changed the focus
+       handler -- with hildon-time-editor and hildon-date-editor, if we
+       are moving up or down, with the focus inside the widget, we return
+       false to force moving to the next widget outside. Fixes #NB36938.
+
+2006-09-14  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * hildon-widgets/hildon-defines.c: Ensure the style before setting the
        logical color. Fixes #NB40041.
 
index 8d2b495..ec3308f 100644 (file)
@@ -25,6 +25,8 @@
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkwindow.h>
 #include "hildon-composite-widget.h"
+#include "hildon-date-editor.h"
+#include "hildon-time-editor.h"
 
 /* This function is a private function of hildon-libs. It hadles focus 
  * changing for composite hildon widgets: HildonDateEditor, 
@@ -50,11 +52,28 @@ hildon_composite_widget_focus (GtkWidget *widget, GtkDirectionType direction)
     return TRUE;
 
   if (!gtk_widget_is_ancestor (focus_widget, widget))
-    /* Containers grab_focus grabs the focus to the correct widget */
-    gtk_widget_grab_focus (widget);
+    {
+      gtk_widget_grab_focus (widget);
+    }
   else
-    return GTK_WIDGET_CLASS (g_type_class_peek_parent (
-                     GTK_WIDGET_GET_CLASS(widget)))->focus (widget, direction);
+    {
+      /* Containers grab_focus grabs the focus to the correct widget */
+      switch (direction) {
+      case GTK_DIR_UP:
+      case GTK_DIR_DOWN:
+        if (HILDON_IS_DATE_EDITOR(widget) || HILDON_IS_TIME_EDITOR(widget))
+          return FALSE;
+        else
+          return GTK_WIDGET_CLASS (g_type_class_peek_parent
+                                   (GTK_WIDGET_GET_CLASS(widget)))->focus (widget, direction);
+        break;
+
+      default:
+        return GTK_WIDGET_CLASS (g_type_class_peek_parent
+                                 (GTK_WIDGET_GET_CLASS(widget)))->focus (widget, direction);
+        break;
+      }
+    }
 
   return TRUE;
 }