aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-01-15 06:33:46 +0800
committerChris Toshok <toshok@src.gnome.org>2003-01-15 06:33:46 +0800
commit09ea004d1326f19dbe3a6305b0480235bb01279e (patch)
treec1ccf34a969d21eb8a2ee54ead7da63e76a618c1
parent962c8a0d9fcc069cb851a70d52298353e1ec18b5 (diff)
downloadgsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.tar
gsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.tar.gz
gsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.tar.bz2
gsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.tar.lz
gsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.tar.xz
gsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.tar.zst
gsoc2013-evolution-09ea004d1326f19dbe3a6305b0480235bb01279e.zip
use PangoFontMetrics here instead of using the ascent/descent of the
2003-01-14 Chris Toshok <toshok@ximian.com> * 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
-rw-r--r--widgets/text/e-entry.c13
1 files changed, 11 insertions, 2 deletions
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