2005-05-02 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcellrenderertext.c (get_size): Return a sufficient
+ width for cases where pango_layout_get_pixel_extents() returns
+ a rectangle with nonzero x.
+
* gtk/gtkselection.c: Small doc fixes.
* gtk/gtkmenushell.c (gtk_menu_shell_set_take_focus):
2005-05-02 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcellrenderertext.c (get_size): Return a sufficient
+ width for cases where pango_layout_get_pixel_extents() returns
+ a rectangle with nonzero x.
+
* gtk/gtkselection.c: Small doc fixes.
* gtk/gtkmenushell.c (gtk_menu_shell_set_take_focus):
2005-05-02 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcellrenderertext.c (get_size): Return a sufficient
+ width for cases where pango_layout_get_pixel_extents() returns
+ a rectangle with nonzero x.
+
* gtk/gtkselection.c: Small doc fixes.
* gtk/gtkmenushell.c (gtk_menu_shell_set_take_focus):
pango_layout_get_pixel_extents (layout, NULL, &rect);
if (height)
- *height = GTK_CELL_RENDERER (celltext)->ypad * 2 + rect.height;
+ *height = cell->ypad * 2 + rect.height;
/* The minimum size for ellipsized labels is ~ 3 chars */
if (width)
char_width = pango_font_metrics_get_approximate_char_width (metrics);
pango_font_metrics_unref (metrics);
- *width = GTK_CELL_RENDERER (celltext)->xpad * 2
- + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
+ *width = cell->xpad * 2 + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
}
else
{
- *width = GTK_CELL_RENDERER (celltext)->xpad * 2 + rect.width;
+ *width = cell->xpad * 2 + rect.x + rect.width;
}
}
if (x_offset)
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- *x_offset = (1.0 - cell->xalign) * (cell_area->width - rect.width - (2 * cell->xpad));
+ *x_offset = (1.0 - cell->xalign) * (cell_area->width - (rect.x + rect.width + 2 * cell->xpad));
else
- *x_offset = cell->xalign * (cell_area->width - rect.width - (2 * cell->xpad));
+ *x_offset = cell->xalign * (cell_area->width - (rect.x + rect.width + 2 * cell->xpad));
if (priv->ellipsize_set || priv->wrap_width != -1)
*x_offset = MAX(*x_offset, 0);
}
if (y_offset)
{
- *y_offset = cell->yalign * (cell_area->height - rect.height - (2 * cell->ypad));
+ *y_offset = cell->yalign * (cell_area->height - (rect.height + 2 * cell->ypad));
*y_offset = MAX (*y_offset, 0);
}
}