+2007-05-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ * src/hildon-caption.c: Implementing the proper focus grabbing in the
+ HildonCaption. Fixes NB#52379.
+
2007-05-30 Xan Lopez <xan.lopez@nokia.com>
* src/hildon-bread-crumb-trail.c (crumb_activated_cb): be very paranoid about
is removed and the user still lets the default handler run. This would segfault
previously.
-2007-05-28 Michael Dominic K. <michael.kostrzewa@nokia.com>
+2007-05-28 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
* src/hildon-font-selection-dialog.c: When the font is really big, add the
scrollbar to the preview dialog. Fixes NB#54147.
GtkWidget *caption);
static void
+hildon_caption_grab_focus (GtkWidget *widget);
+
+static void
hildon_caption_activate (GtkWidget *widget);
static void
widget_class->size_request = hildon_caption_size_request;
widget_class->size_allocate = hildon_caption_size_allocate;
widget_class->button_press_event = hildon_caption_button_press;
+ widget_class->grab_focus = hildon_caption_grab_focus;
/* Create new signals and properties */
widget_class->activate_signal = g_signal_new ("activate",
g_assert (priv);
GtkWidget *child = GTK_BIN (widget)->child;
- /* nothing to do */
- if (priv->is_focused == TRUE)
- return FALSE;
-
- /* If child can take focus, we simply grab focus to it */
- if ((GTK_WIDGET_CAN_FOCUS (child) || GTK_IS_CONTAINER (child)) &&
- GTK_WIDGET_IS_SENSITIVE (child))
- {
- /* Only if container can be focusable we must set is_focused to TRUE */
- if (GTK_IS_CONTAINER (child))
- {
- if (gtk_widget_child_focus (child, GTK_DIR_TAB_FORWARD))
- priv->is_focused = TRUE;
- }
- else
- {
- priv->is_focused = TRUE;
- gtk_widget_grab_focus (GTK_BIN (widget)->child);
- }
- }
+ priv->is_focused = TRUE;
+ gtk_widget_grab_focus (GTK_BIN (widget)->child);
return FALSE;
}
gtk_widget_grab_focus (child);
}
+static void
+hildon_caption_grab_focus (GtkWidget *widget)
+{
+ gtk_widget_grab_focus (GTK_BIN (widget)->child);
+}
+
/**
* hildon_caption_set_child_expand:
* @caption : a #HildonCaption