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.
#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,
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;
}