2008-09-24 Claudio Saavedra <csaavedra@igalia.com>
[hildon] / src / hildon-font-selection-dialog.c
index 6e4ec5c..33910f4 100644 (file)
 #include                                        <config.h>
 #endif
 
+#include                                        <libintl.h>
 #include                                        <stdlib.h>
 #include                                        <string.h>
-#include                                        <gtk/gtkstock.h>
-#include                                        <gtk/gtkcombobox.h>
-#include                                        <gtk/gtktogglebutton.h>
-#include                                        <gtk/gtkcheckbutton.h>
-#include                                        <gtk/gtklabel.h>
-#include                                        <gtk/gtkvbox.h>
-#include                                        <gtk/gtkliststore.h>
-#include                                        <gtk/gtknotebook.h>
-#include                                        <gtk/gtk.h>
+
 #include                                        <glib.h>
 #include                                        <gdk/gdkkeysyms.h>
+
 #include                                        "hildon-font-selection-dialog.h"
 #include                                        "hildon-caption.h"
 #include                                        "hildon-color-button.h"
-#include                                        <libintl.h>
 #include                                        "hildon-font-selection-dialog-private.h"
 
 /* These are what we use as the standard font sizes, for the size list */
@@ -889,6 +882,8 @@ hildon_font_selection_dialog_construct_notebook (HildonFontSelectionDialog *font
                 priv->cbx_positioning, NULL,
                 HILDON_CAPTION_OPTIONAL);
 
+    g_object_unref (group);
+
     gtk_box_pack_start (GTK_BOX (vbox_tab[2]), caption_control, FALSE, FALSE, 0);
 
     /* Populate notebook */
@@ -1213,6 +1208,12 @@ hildon_font_selection_dialog_show_preview       (HildonFontSelectionDialog *font
             GTK_WINDOW (fontsel));
 
     gtk_widget_show_all (preview_dialog);
+    gtk_dialog_set_default_response (GTK_DIALOG (preview_dialog), GTK_RESPONSE_OK);
+    
+    GtkBox *action_area = (GtkBox *) GTK_DIALOG (preview_dialog)->action_area;
+    GtkWidget *button = ((GtkBoxChild *) ((GSList *) action_area->children)->data)->widget;
+    gtk_widget_grab_focus (button);
+
     gtk_dialog_run (GTK_DIALOG (preview_dialog));
     gtk_widget_destroy (preview_dialog);
 }