]> saetta.ns0.it Git - libgtkdateentry/commitdiff
Bugfix on showing calendar window.
authorAndrea Zagli <azagli@libero.it>
Wed, 11 Nov 2009 17:40:57 +0000 (18:40 +0100)
committerAndrea Zagli <azagli@libero.it>
Wed, 11 Nov 2009 17:40:57 +0000 (18:40 +0100)
docs/reference/gtkdateentry.args
src/gtkdateentry.c

index c2ba6066f6bf4cc4814446afb30b0704f06453a9..a3f00923bc6bd721e954d3aef01c36edf4443d55 100644 (file)
@@ -3,8 +3,8 @@
 <TYPE>gboolean</TYPE>
 <RANGE></RANGE>
 <FLAGS>rw</FLAGS>
-<NICK>Tabulation inside the widget</NICK>
-<BLURB>Whether pressing tab moves between mask's parts or outside the widget.</BLURB>
+<NICK>TRUE if it is editable only from calendar</NICK>
+<BLURB>Determines if the user can edit the text in the #GtkDateEntry widget only from the calendar or not.</BLURB>
 <DEFAULT>FALSE</DEFAULT>
 </ARG>
 
index d62428f5e5bcee07e8a05bf2cb0a47f6c3f148b2..1c9aea1f6a55204ecc115180bccf2fafc407b4ed 100644 (file)
@@ -133,8 +133,9 @@ gtk_date_entry_class_init (GtkDateEntryClass *klass)
 
        g_object_class_install_property (object_class, PROP_EDITABLE_WITH_CALENDAR,
                                         g_param_spec_boolean ("editable-with-calendar",
-                                                              "Tabulation inside the widget",
-                                                              "Whether pressing tab moves between mask's parts or outside the widget",
+                                                              "TRUE if it is editable only from calendar",
+                                                              "Determines if the user can edit the text"
+                                                              " in the #GtkDateEntry widget only from the calendar or not",
                                                               FALSE,
                                                               G_PARAM_READWRITE));
 }
@@ -163,7 +164,7 @@ gtk_date_entry_init (GtkDateEntry *date)
        gtk_widget_show (priv->btnCalendar);
 
        g_signal_connect (G_OBJECT (priv->btnCalendar), "toggled",
-                                                                               G_CALLBACK (btnCalendar_on_toggled), (gpointer)date);
+                         G_CALLBACK (btnCalendar_on_toggled), (gpointer)date);
 
        arrow = (GtkWidget *)gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
        gtk_container_add (GTK_CONTAINER (priv->btnCalendar), arrow);
@@ -266,7 +267,7 @@ gtk_date_entry_set_format (GtkDateEntry *date, const gchar *format)
                }
        
        format_ = g_strstrip (g_strdup (format));
-  if (strlen (format_) != 3)
+       if (strlen (format_) != 3)
                {
                        return FALSE;
                }
@@ -298,7 +299,7 @@ gtk_date_entry_set_format (GtkDateEntry *date, const gchar *format)
 
        gdate = gtk_date_entry_get_gdate (date);
 
-  priv->format = g_strdup (format);
+       priv->format = g_strdup (format);
        gtk_date_entry_change_mask (date);
        gtk_date_entry_set_date_gdate (date, gdate);
 
@@ -318,7 +319,7 @@ const gchar
 {
        GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
 
-  return gtk_entry_get_text (GTK_ENTRY (priv->day));
+       return gtk_entry_get_text (GTK_ENTRY (priv->day));
 }
 
 /**
@@ -861,9 +862,11 @@ btnCalendar_on_toggled (GtkToggleButton *togglebutton,
                        if (x < 0) x = 0;
                        if (y < 0) y = 0;
 
+                       gtk_editable_set_position (GTK_EDITABLE (priv->day), 0);
+
                        gtk_grab_add (wCalendar);
                        gtk_window_move (GTK_WINDOW (wCalendar), x, y);
-      gtk_widget_show (wCalendar);
+                       gtk_widget_show (wCalendar);
                        gtk_widget_grab_focus (priv->calendar);
                        popup_grab_on_window (wCalendar->window, gtk_get_current_event_time ());
                }