2006-09-19 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Wed, 20 Sep 2006 09:41:53 +0000 (09:41 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Wed, 20 Sep 2006 09:41:53 +0000 (09:41 +0000)
* hildon-widgets/hildon-date-editor.c:
(hildon_date_editor_keypress): On left or right key pressed, it
first takes in consideration the current cursor position inside
the entries. If it's in an edge, focus moves to the widget on the
right or left. Fixes #NB40770.

ChangeLog
hildon-widgets/hildon-date-editor.c

index 08532b9..b137926 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2006-09-19  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * hildon-widgets/hildon-date-editor.c:
+       (hildon_date_editor_keypress): On left or right key pressed, it
+       first takes in consideration the current cursor position inside
+       the entries. If it's in an edge, focus moves to the widget on the
+       right or left. Fixes #NB40770.
+
+2006-09-19  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * hildon-widgets-plugins/hildon-color-chooser-dialog-hsv.c: Agh...
        correcting silly mistake.  
 
index 89be988..4bbbb60 100644 (file)
@@ -1069,15 +1069,19 @@ static gboolean hildon_date_editor_keypress(GtkWidget * widget,
     ed = HILDON_DATE_EDITOR(data);
     priv = HILDON_DATE_EDITOR_GET_PRIVATE(ed);
     pos = gtk_editable_get_position(GTK_EDITABLE(widget));
-       
+
     switch (event->keyval) {
     case GDK_Left:
-        (void) gtk_widget_child_focus(GTK_WIDGET(data), GTK_DIR_LEFT);
-        return TRUE;
+        if (pos == 0) {
+          (void) gtk_widget_child_focus(GTK_WIDGET(data), GTK_DIR_LEFT);
+          return TRUE;
+        }
         break;
     case GDK_Right:
-        (void) gtk_widget_child_focus(GTK_WIDGET(data), GTK_DIR_RIGHT);
-        return TRUE;
+        if (pos >= g_utf8_strlen(gtk_entry_get_text(GTK_ENTRY(widget)), -1)) {
+          (void) gtk_widget_child_focus(GTK_WIDGET(data), GTK_DIR_RIGHT);
+          return TRUE;
+        }
         break;
     case GDK_Return:
     case GDK_ISO_Enter: