Adding the seekbar example to check theming easily. Fixing the default focus for...
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 23 Jul 2007 14:21:22 +0000 (14:21 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 23 Jul 2007 14:21:22 +0000 (14:21 +0000)
ChangeLog
examples/Makefile.am
examples/hildon-seekbar-example.c [new file with mode: 0644]
src/hildon-font-selection-dialog.c

index 33c31b3..2777484 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2007-07-23  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * examples/Makefile.am:
+       * examples/hildon-seekbar-example.c: Adding the seekbar example to check
+       theming easily.
+
+       * src/hildon-font-selection-dialog.c: Fixing the default focus for dialog
+       when font size > 32 and we pack a focusable widget inside. Actually using
+       the default response would work too, but since we don't show default
+       response state in any way (no theming) it would not be visible to the
+       user. Fixes NB#60575.
+
+2007-07-23  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * src/hildon-date-editor.c: Adding the missing variable setter in the
        set_property handler. Fixes NB#54182.
 
index 2a022ad..28b7dfc 100644 (file)
@@ -32,13 +32,19 @@ noinst_PROGRAMS                             = hildon-window-example                         \
                                          hildon-thumb-scrollbar-example                \
                                          hildon-date-editor-example                    \
                                          hildon-bread-crumb-trail-example              \
-                                         hildon-finger-example
+                                         hildon-finger-example                         \
+                                         hildon-seekbar-example
 
 # Hildon window
 hildon_window_example_LDADD            = $(HILDON_OBJ_LIBS)
 hildon_window_example_CFLAGS           = $(HILDON_OBJ_CFLAGS)
 hildon_window_example_SOURCES          = hildon-window-example.c
 
+# Hildon seekbar
+hildon_seekbar_example_LDADD           = $(HILDON_OBJ_LIBS)
+hildon_seekbar_example_CFLAGS          = $(HILDON_OBJ_CFLAGS)
+hildon_seekbar_example_SOURCES         = hildon-seekbar-example.c
+
 # Hildon finger
 hildon_finger_example_LDADD            = $(HILDON_OBJ_LIBS)
 hildon_finger_example_CFLAGS           = $(HILDON_OBJ_CFLAGS)
diff --git a/examples/hildon-seekbar-example.c b/examples/hildon-seekbar-example.c
new file mode 100644 (file)
index 0000000..0175b85
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * This file is a part of hildon examples
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
+ *
+ * Author: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include                                        <stdio.h>
+#include                                        <stdlib.h>
+#include                                        <glib.h>
+#include                                        <gtk/gtk.h>
+#include                                        "hildon.h"
+
+int
+main                                            (int argc, 
+                                                 char **args)
+{
+    gtk_init (&argc, &args);
+    
+    GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
+
+    HildonSeekbar *bar = HILDON_SEEKBAR (hildon_seekbar_new ());
+    gtk_widget_set_size_request (GTK_WIDGET (bar), 400, -1);
+
+    hildon_seekbar_set_total_time (bar, 100);
+    hildon_seekbar_set_position (bar, 50);
+
+    gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (bar), FALSE, FALSE, 0);
+    gtk_dialog_add_button (dialog, "Close", GTK_RESPONSE_CLOSE);
+
+    gtk_widget_show_all (GTK_WIDGET (dialog));
+    gtk_dialog_run (dialog);
+
+    return 0;
+}
+
+
index 6e4ec5c..c473149 100644 (file)
@@ -1213,6 +1213,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);
 }