mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
Don't allow -1 as minimum-key-length. (gtk_entry_completion_set_model):
2005-01-26 Matthias Clasen <mclasen@redhat.com> * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Don't allow -1 as minimum-key-length. (gtk_entry_completion_set_model): Add missing notification. (gtk_entry_completion_set_minimum_key_length): Add missing notification, allow setting minimum-key-length to 0. (#165194, Vincent Ladeuil)
This commit is contained in:
parent
9e22092166
commit
d5102464a3
@ -1,3 +1,12 @@
|
||||
2005-01-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
|
||||
Don't allow -1 as minimum-key-length.
|
||||
(gtk_entry_completion_set_model): Add missing notification.
|
||||
(gtk_entry_completion_set_minimum_key_length): Add missing
|
||||
notification, allow setting minimum-key-length to 0. (#165194,
|
||||
Vincent Ladeuil)
|
||||
|
||||
2005-01-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaboutdialog.c (display_license_dialog): Make sure
|
||||
|
@ -1,3 +1,12 @@
|
||||
2005-01-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
|
||||
Don't allow -1 as minimum-key-length.
|
||||
(gtk_entry_completion_set_model): Add missing notification.
|
||||
(gtk_entry_completion_set_minimum_key_length): Add missing
|
||||
notification, allow setting minimum-key-length to 0. (#165194,
|
||||
Vincent Ladeuil)
|
||||
|
||||
2005-01-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaboutdialog.c (display_license_dialog): Make sure
|
||||
|
@ -1,3 +1,12 @@
|
||||
2005-01-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
|
||||
Don't allow -1 as minimum-key-length.
|
||||
(gtk_entry_completion_set_model): Add missing notification.
|
||||
(gtk_entry_completion_set_minimum_key_length): Add missing
|
||||
notification, allow setting minimum-key-length to 0. (#165194,
|
||||
Vincent Ladeuil)
|
||||
|
||||
2005-01-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkaboutdialog.c (display_license_dialog): Make sure
|
||||
|
@ -5178,7 +5178,8 @@ gtk_entry_completion_changed (GtkWidget *entry,
|
||||
return;
|
||||
|
||||
/* no need to normalize for this test */
|
||||
if (! strcmp ("", gtk_entry_get_text (GTK_ENTRY (entry))))
|
||||
if (completion->priv->minimum_key_length > 0 &&
|
||||
strcmp ("", gtk_entry_get_text (GTK_ENTRY (entry))) == 0)
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
|
||||
_gtk_entry_completion_popdown (completion);
|
||||
|
@ -278,7 +278,7 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass)
|
||||
g_param_spec_int ("minimum_key_length",
|
||||
P_("Minimum Key Length"),
|
||||
P_("Minimum length of the search key in order to look up matches"),
|
||||
-1,
|
||||
0,
|
||||
G_MAXINT,
|
||||
1,
|
||||
G_PARAM_READWRITE));
|
||||
@ -942,6 +942,8 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion,
|
||||
GTK_TREE_MODEL (completion->priv->filter_model));
|
||||
g_object_unref (completion->priv->filter_model);
|
||||
|
||||
g_object_notify (G_OBJECT (completion), "model");
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
|
||||
_gtk_entry_completion_resize_popup (completion);
|
||||
}
|
||||
@ -1014,9 +1016,14 @@ gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion,
|
||||
gint length)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
|
||||
g_return_if_fail (length >= 1);
|
||||
g_return_if_fail (length >= 0);
|
||||
|
||||
completion->priv->minimum_key_length = length;
|
||||
if (completion->priv->minimum_key_length != length)
|
||||
{
|
||||
completion->priv->minimum_key_length = length;
|
||||
|
||||
g_object_notify (G_OBJECT (completion), "minimum_key_length");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user