X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon-number-editor.c;h=2d447719418104246583f849f3ba22c231259885;hb=db9685e21af93630b100473c49d066de0ad3691f;hp=a368151b612722c333e05a7bc367d54ea0068412;hpb=497e6bb9e8c390a654bca81849a047d40c7d9c96;p=hildon diff --git a/src/hildon-number-editor.c b/src/hildon-number-editor.c index a368151..2d44771 100644 --- a/src/hildon-number-editor.c +++ b/src/hildon-number-editor.c @@ -8,7 +8,7 @@ * 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. + * 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 @@ -39,23 +39,25 @@ * */ +#undef HILDON_DISABLE_DEPRECATED + #ifdef HAVE_CONFIG_H #include #endif -#include "hildon-number-editor.h" -#include -#include #include #include #include +#include +#include + +#include "hildon-number-editor.h" #include "hildon-marshalers.h" -#include "hildon-private.h" #include "hildon-defines.h" #include "hildon-enum-types.h" #include "hildon-banner.h" -#include #include "hildon-number-editor-private.h" +#include "hildon-private.h" #define _(String) dgettext("hildon-libs", String) @@ -96,6 +98,10 @@ hildon_number_editor_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean +hildon_number_editor_focus (GtkWidget *widget, + GtkDirectionType direction); + +static gboolean hildon_number_editor_entry_keypress (GtkWidget *widget, GdkEventKey *event, gpointer data); @@ -220,7 +226,7 @@ hildon_number_editor_class_init (HildonNumberEditorClass *editor widget_class->size_request = hildon_number_editor_size_request; widget_class->size_allocate = hildon_number_editor_size_allocate; - widget_class->focus = hildon_private_composite_focus; + widget_class->focus = hildon_number_editor_focus; editor_class->range_error = hildon_number_editor_range_error; @@ -406,8 +412,10 @@ hildon_number_editor_init (HildonNumberEditor *editor) G_CALLBACK (hildon_number_editor_button_released), editor); +#ifdef MAEMO_GTK g_object_set (G_OBJECT (priv->num_entry), - "input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL); + "hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL); +#endif gtk_widget_show (priv->num_entry); gtk_widget_show (priv->minus); @@ -501,7 +509,8 @@ hildon_number_editor_start_timer (HildonNumberEditor *editor) priv = HILDON_NUMBER_EDITOR_GET_PRIVATE (editor); settings = gtk_settings_get_default (); - g_object_get (settings, "gtk-timeout-update", &timeout, NULL); + g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL); + timeout *= 8; priv->button_event_id = g_timeout_add (timeout, (GSourceFunc) do_mouse_timeout, @@ -758,6 +767,23 @@ hildon_number_editor_size_allocate (GtkWidget *widget, } static gboolean +hildon_number_editor_focus (GtkWidget *widget, + GtkDirectionType direction) +{ + gboolean retval; + GtkDirectionType effective_direction; + + g_assert (HILDON_IS_NUMBER_EDITOR (widget)); + + retval = hildon_private_composite_focus (widget, direction, &effective_direction); + + if (retval == TRUE) + return GTK_WIDGET_CLASS (parent_class)->focus (widget, effective_direction); + else + return FALSE; +} + +static gboolean hildon_number_editor_entry_focusout (GtkWidget *widget, GdkEventFocus *event, gpointer data)