From a02bdaa351dcda5394fe718beca755eea21d0e25 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Sep 2004 18:05:29 +0000 Subject: [PATCH] Resize the popup if the model is replaced. (#152333) 2004-09-13 Matthias Clasen * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model): Resize the popup if the model is replaced. (#152333) (_gtk_entry_completion_resize_popup): Improve positioning of entry completion popup. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtkentrycompletion.c | 6 +++--- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1067af5a0b..8c5dfeba80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model): Resize the + popup if the model is replaced. (#152333) + (_gtk_entry_completion_resize_popup): + Improve positioning of entry completion popup. + 2004-09-09 Matthias Clasen * tests/testfilechooser.c (main): Update sensitivity of the "Select all" diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1067af5a0b..8c5dfeba80 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model): Resize the + popup if the model is replaced. (#152333) + (_gtk_entry_completion_resize_popup): + Improve positioning of entry completion popup. + 2004-09-09 Matthias Clasen * tests/testfilechooser.c (main): Update sensitivity of the "Select all" diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1067af5a0b..8c5dfeba80 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model): Resize the + popup if the model is replaced. (#152333) + (_gtk_entry_completion_resize_popup): + Improve positioning of entry completion popup. + 2004-09-09 Matthias Clasen * tests/testfilechooser.c (main): Update sensitivity of the "Select all" diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1067af5a0b..8c5dfeba80 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2004-09-13 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model): Resize the + popup if the model is replaced. (#152333) + (_gtk_entry_completion_resize_popup): + Improve positioning of entry completion popup. + 2004-09-09 Matthias Clasen * tests/testfilechooser.c (main): Update sensitivity of the "Select all" diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index fb51fb07e4..099201eafb 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -834,6 +834,9 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion, gtk_tree_view_set_model (GTK_TREE_VIEW (completion->priv->tree_view), GTK_TREE_MODEL (completion->priv->filter_model)); g_object_unref (G_OBJECT (completion->priv->filter_model)); + + if (GTK_WIDGET_VISIBLE (completion->priv->popup_window)) + _gtk_entry_completion_resize_popup (completion); } /** @@ -1158,9 +1161,6 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) gdk_window_get_origin (completion->priv->entry->window, &x, &y); get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border); - x += x_border; - y += 2 * y_border; - matches = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (completion->priv->filter_model), NULL); items = MIN (matches, 15);