Fix #150822, reported by Christian Persch

2004-08-23  Matthias Clasen  <mclasen@redhat.com>

	Fix #150822, reported by Christian Persch

	* gtk/gtklabel.c (gtk_label_ensure_layout): Set the layout width
	appropriately when ellipsized.
	(gtk_label_size_allocate): Only set the layout width if there
	is a layout.
This commit is contained in:
Matthias Clasen 2004-08-23 15:37:23 +00:00 committed by Matthias Clasen
parent 31b681948c
commit a578e11346
5 changed files with 45 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2004-08-23 Matthias Clasen <mclasen@redhat.com>
Fix #150822, reported by Christian Persch
* gtk/gtklabel.c (gtk_label_ensure_layout): Set the layout width
appropriately when ellipsized.
(gtk_label_size_allocate): Only set the layout width if there
is a layout.
2004-08-23 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest

View File

@ -1,3 +1,12 @@
2004-08-23 Matthias Clasen <mclasen@redhat.com>
Fix #150822, reported by Christian Persch
* gtk/gtklabel.c (gtk_label_ensure_layout): Set the layout width
appropriately when ellipsized.
(gtk_label_size_allocate): Only set the layout width if there
is a layout.
2004-08-23 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest

View File

@ -1,3 +1,12 @@
2004-08-23 Matthias Clasen <mclasen@redhat.com>
Fix #150822, reported by Christian Persch
* gtk/gtklabel.c (gtk_label_ensure_layout): Set the layout width
appropriately when ellipsized.
(gtk_label_size_allocate): Only set the layout width if there
is a layout.
2004-08-23 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest

View File

@ -1,3 +1,12 @@
2004-08-23 Matthias Clasen <mclasen@redhat.com>
Fix #150822, reported by Christian Persch
* gtk/gtklabel.c (gtk_label_ensure_layout): Set the layout width
appropriately when ellipsized.
(gtk_label_size_allocate): Only set the layout width if there
is a layout.
2004-08-23 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest

View File

@ -1537,7 +1537,10 @@ gtk_label_ensure_layout (GtkLabel *label)
pango_layout_set_alignment (label->layout, align);
pango_layout_set_ellipsize (label->layout, label->ellipsize);
if (label->wrap)
if (label->ellipsize)
pango_layout_set_width (label->layout,
widget->allocation.width * PANGO_SCALE);
else if (label->wrap)
{
GtkWidgetAuxInfo *aux_info;
gint longest_paragraph;
@ -1604,7 +1607,7 @@ gtk_label_ensure_layout (GtkLabel *label)
pango_layout_set_width (label->layout, width);
}
}
else /* !label->wrap */
else /* !label->wrap */
pango_layout_set_width (label->layout, -1);
}
}
@ -1687,7 +1690,10 @@ gtk_label_size_allocate (GtkWidget *widget,
(* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
if (label->ellipsize)
pango_layout_set_width (label->layout, allocation->width * PANGO_SCALE);
{
if (label->layout)
pango_layout_set_width (label->layout, allocation->width * PANGO_SCALE);
}
if (label->select_info && label->select_info->window)
{