Restrict the width of the popup to be no larger than the monitor.

2004-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
	Restrict the width of the popup to be no larger than the
	monitor.  (#142678, DmD Ljungmark)
This commit is contained in:
Matthias Clasen 2004-05-18 18:31:54 +00:00 committed by Matthias Clasen
parent f2801c7efc
commit 460dfabb87
5 changed files with 54 additions and 10 deletions

View File

@ -1,5 +1,16 @@
2004-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
Restrict the width of the popup to be no larger than the
monitor. (#142678, DmD Ljungmark)
* gtk/gtkbutton.c: Go back to the initial fix for the
focus-overdrawing problem, which was actually correct
according to docs/widget_geometry.txt.
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
arrow size from 11 to 15 to compensate for that.
* gtk/gtktextview.c (gtk_text_view_class_init): Document the
arguments of the ::move-cursor signal. (#142725)

View File

@ -1,5 +1,16 @@
2004-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
Restrict the width of the popup to be no larger than the
monitor. (#142678, DmD Ljungmark)
* gtk/gtkbutton.c: Go back to the initial fix for the
focus-overdrawing problem, which was actually correct
according to docs/widget_geometry.txt.
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
arrow size from 11 to 15 to compensate for that.
* gtk/gtktextview.c (gtk_text_view_class_init): Document the
arguments of the ::move-cursor signal. (#142725)

View File

@ -1,5 +1,16 @@
2004-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
Restrict the width of the popup to be no larger than the
monitor. (#142678, DmD Ljungmark)
* gtk/gtkbutton.c: Go back to the initial fix for the
focus-overdrawing problem, which was actually correct
according to docs/widget_geometry.txt.
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
arrow size from 11 to 15 to compensate for that.
* gtk/gtktextview.c (gtk_text_view_class_init): Document the
arguments of the ::move-cursor signal. (#142725)

View File

@ -1,5 +1,16 @@
2004-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
Restrict the width of the popup to be no larger than the
monitor. (#142678, DmD Ljungmark)
* gtk/gtkbutton.c: Go back to the initial fix for the
focus-overdrawing problem, which was actually correct
according to docs/widget_geometry.txt.
* gtk/gtkarrow.c (gtk_arrow_class_init): Bump the initial
arrow size from 11 to 15 to compensate for that.
* gtk/gtktextview.c (gtk_text_view_class_init): Document the
arguments of the ::move-cursor signal. (#142725)

View File

@ -1091,7 +1091,8 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
GtkRequisition popup_req;
GtkTreePath *path;
gboolean above;
gint width;
gdk_window_get_origin (completion->priv->entry->window, &x, &y);
get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border);
@ -1110,9 +1111,14 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
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);
width = MIN (completion->priv->entry->allocation.width, monitor.width);
gtk_widget_set_size_request (completion->priv->tree_view,
completion->priv->entry->allocation.width - 2 * x_border,
items * height);
width - 2 * x_border, items * height);
/* default on no match */
completion->priv->current_selected = -1;
@ -1128,18 +1134,12 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
&height);
gtk_widget_set_size_request (completion->priv->action_view,
completion->priv->entry->allocation.width - 2 * x_border,
items * height);
width - 2 * x_border, items * height);
}
else
gtk_widget_hide (completion->priv->action_view);
gtk_widget_size_request (completion->priv->popup_window, &popup_req);
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 (x < monitor.x)
x = monitor.x;