Commit dcfefba2 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

limit the number of displayed items by the actual screen height instead of

2008-06-12  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
	limit the number of displayed items by the actual screen height
	instead of some arbitrary value (Bug #408154, Xan Lopez and
	Christian Dywan).


svn path=/trunk/; revision=20359
parent d76e3d55
2008-06-12 Michael Natterer <mitch@imendio.com>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
limit the number of displayed items by the actual screen height
instead of some arbitrary value (Bug #408154, Xan Lopez and
Christian Dywan).
2008-06-11 Behdad Esfahbod <behdad@gnome.org>
Bug 503071 – Application direction changes to right to left even if
......
......@@ -1383,8 +1383,6 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
matches = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (completion->priv->filter_model), NULL);
items = MIN (matches, 15);
gtk_tree_view_column_cell_get_size (completion->priv->column, NULL,
NULL, NULL, NULL, &height);
......@@ -1396,16 +1394,23 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
gtk_widget_realize (completion->priv->tree_view);
if (items <= 0)
gtk_widget_hide (completion->priv->scrolled_window);
else
gtk_widget_show (completion->priv->scrolled_window);
screen = gtk_widget_get_screen (GTK_WIDGET (completion->priv->entry));
monitor_num = gdk_screen_get_monitor_at_window (screen,
GTK_WIDGET (completion->priv->entry)->window);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
if (y > monitor.height / 2)
items = MIN (matches, (monitor.y + y) / height);
else
items = MIN (matches, (monitor.height - y) / height - 1);
if (items <= 0)
gtk_widget_hide (completion->priv->scrolled_window);
else
gtk_widget_show (completion->priv->scrolled_window);
if (completion->priv->popup_set_width)
width = MIN (completion->priv->entry->allocation.width, monitor.width) - 2 * x_border;
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment