- if (widget->allocation.width >= widget->requisition.width + ac_width)
- {
- PangoLayout *label_layout;
- PangoLayout *accel_layout;
- GtkLabel *label = GTK_LABEL (widget);
-
- gint x;
- gint y;
-
- label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
-
- 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 (gtk_accel_label_parent_class)->expose_event)
- GTK_WIDGET_CLASS (gtk_accel_label_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;
- else
- x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width;
+ allocation.width -= ac_width;
+ gtk_widget_set_allocation (widget, &allocation);
+ if (GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->draw)
+ GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->draw (widget,
+ cr);
+ allocation.width += ac_width;
+ gtk_widget_set_allocation (widget, &allocation);
+ if (gtk_label_get_ellipsize (label))
+ pango_layout_set_width (label_layout,
+ pango_layout_get_width (label_layout)
+ + ac_width * PANGO_SCALE);
+
+ cairo_restore (cr);
+
+ gtk_misc_get_padding (misc, &xpad, NULL);
+
+ if (direction == GTK_TEXT_DIR_RTL)
+ x = xpad;
+ else
+ x = gtk_widget_get_allocated_width (widget) - xpad - ac_width;