From 09ea004d1326f19dbe3a6305b0480235bb01279e Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 14 Jan 2003 22:33:46 +0000 Subject: use PangoFontMetrics here instead of using the ascent/descent of the 2003-01-14 Chris Toshok * gal/e-text/e-entry.c (canvas_size_request): use PangoFontMetrics here instead of using the ascent/descent of the GtkStyle's font. svn path=/trunk/; revision=19468 --- widgets/text/e-entry.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'widgets/text') diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c index 685dfdc6c2..06826a42d5 100644 --- a/widgets/text/e-entry.c +++ b/widgets/text/e-entry.c @@ -170,11 +170,14 @@ canvas_size_request (GtkWidget *widget, GtkRequisition *requisition, EEntry *entry) { int xthick, ythick; + PangoContext *context; + PangoFontMetrics *metrics; g_return_if_fail (widget != NULL); g_return_if_fail (GNOME_IS_CANVAS (widget)); g_return_if_fail (requisition != NULL); + if (entry->priv->draw_borders) { xthick = 2 * widget->style->xthickness; ythick = 2 * widget->style->ythickness; @@ -197,9 +200,15 @@ canvas_size_request (GtkWidget *widget, GtkRequisition *requisition, d(g_print("%s: width = %d\n", __FUNCTION__, requisition->width)); - requisition->height = (2 + gtk_style_get_font (widget->style)->ascent + - gtk_style_get_font (widget->style)->descent + + context = gtk_widget_get_pango_context (widget); + metrics = pango_context_get_metrics (context, gtk_widget_get_style (widget)->font_desc, NULL); + + requisition->height = (2 + + PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) + + pango_font_metrics_get_descent (metrics)) + ythick); + + pango_font_metrics_unref (metrics); } static gint -- cgit