From 80fed6c8026b02a46285df144ee18d8b3d9fe492 Mon Sep 17 00:00:00 2001 From: Michael Dominic Kostrzewa Date: Thu, 14 Sep 2006 09:09:33 +0000 Subject: [PATCH] 2006-09-14 Michael Dominic Kostrzewa * 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 | 7 +++++++ hildon-widgets/hildon-composite-widget.c | 27 +++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22f80c0..7415fe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-09-14 Michael Dominic Kostrzewa + * 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 + * hildon-widgets/hildon-defines.c: Ensure the style before setting the logical color. Fixes #NB40041. diff --git a/hildon-widgets/hildon-composite-widget.c b/hildon-widgets/hildon-composite-widget.c index 8d2b495..ec3308f 100644 --- a/hildon-widgets/hildon-composite-widget.c +++ b/hildon-widgets/hildon-composite-widget.c @@ -25,6 +25,8 @@ #include #include #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; } -- 1.7.9.5