Make accel labels ellipsize correctly. (#151559, Christian Persch)

Wed Sep  1 02:38:48 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Make
	accel labels ellipsize correctly.  (#151559, Christian Persch)
This commit is contained in:
Matthias Clasen 2004-09-01 06:39:59 +00:00 committed by Matthias Clasen
parent 018c353d0b
commit 7fdd482866
5 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Wed Sep 1 02:38:48 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Make
accel labels ellipsize correctly. (#151559, Christian Persch)
Wed Sep 1 00:55:56 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkimage.c (gtk_image_clear): Don't leak the iter

View File

@ -1,3 +1,8 @@
Wed Sep 1 02:38:48 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Make
accel labels ellipsize correctly. (#151559, Christian Persch)
Wed Sep 1 00:55:56 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkimage.c (gtk_image_clear): Don't leak the iter

View File

@ -1,3 +1,8 @@
Wed Sep 1 02:38:48 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Make
accel labels ellipsize correctly. (#151559, Christian Persch)
Wed Sep 1 00:55:56 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkimage.c (gtk_image_clear): Don't leak the iter

View File

@ -1,3 +1,8 @@
Wed Sep 1 02:38:48 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Make
accel labels ellipsize correctly. (#151559, Christian Persch)
Wed Sep 1 00:55:56 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkimage.c (gtk_image_clear): Don't leak the iter

View File

@ -320,6 +320,7 @@ gtk_accel_label_expose_event (GtkWidget *widget,
{
PangoLayout *label_layout;
PangoLayout *accel_layout;
GtkLabel *label = GTK_LABEL (widget);
gint x;
gint y;
@ -327,11 +328,20 @@ gtk_accel_label_expose_event (GtkWidget *widget,
if (direction == GTK_TEXT_DIR_RTL)
widget->allocation.x += ac_width;
widget->allocation.width -= ac_width;
if (gtk_label_get_ellipsize (label))
pango_layout_set_width (label->layout,
pango_layout_get_width (label->layout)
- ac_width * PANGO_SCALE);
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
if (direction == GTK_TEXT_DIR_RTL)
widget->allocation.x -= ac_width;
widget->allocation.width += ac_width;
if (gtk_label_get_ellipsize (label))
pango_layout_set_width (label->layout,
pango_layout_get_width (label->layout)
+ ac_width * PANGO_SCALE);
if (direction == GTK_TEXT_DIR_RTL)
x = widget->allocation.x + misc->xpad;