aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-group-container.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-02-09 03:34:11 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-02-09 03:34:11 +0800
commitd328ab72d554fe60c892ddc8c278340c027b51dc (patch)
treef8513f9a30b036d3ff3c3c65be8d9f842ab1f81b /widgets/table/e-table-group-container.c
parent9be6776a1c431142621c5838182fd967febd880e (diff)
downloadgsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.tar
gsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.tar.gz
gsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.tar.bz2
gsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.tar.lz
gsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.tar.xz
gsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.tar.zst
gsoc2013-evolution-d328ab72d554fe60c892ddc8c278340c027b51dc.zip
** Fixes bug #357216
2006-02-08 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #357216 * widgets/text/e-entry.c: Remove "font", "fontset", and "gdk_font" properties, since they forward gets and sets to non-existant properties in entry->item. * widgets/table/e-table-field-chooser-item.c: * widgets/table/e-table-field-chooser-item.h: * widgets/table/e-table-group-container.c: * widgets/table/e-table-group-container.h: Replace deprecated GdkFont with PangoFontDescription. * widgets/table/e-table-header-item.c: * widgets/table/e-table-header-item.h: Replace deprecated GdkFont with PangoFontDescription. Rename "fontset" property to "font-desc", and change the property type to a boxed PangoFontDescription. svn path=/trunk/; revision=33185
Diffstat (limited to 'widgets/table/e-table-group-container.c')
-rw-r--r--widgets/table/e-table-group-container.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index f2060db1ad..b67b76e217 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -105,9 +105,9 @@ etgc_dispose (GObject *object)
if (etgc->children)
e_table_group_container_list_free (etgc);
- if (etgc->font)
- gdk_font_unref (etgc->font);
- etgc->font = NULL;
+ if (etgc->font_desc)
+ pango_font_description_free (etgc->font_desc);
+ etgc->font_desc = NULL;
if (etgc->ecol)
g_object_unref (etgc->ecol);
@@ -148,6 +148,7 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine
{
ETableCol *col;
ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n);
+ GtkStyle *style;
col = e_table_header_get_column_by_col_idx(full_header, column.column);
if (col == NULL)
@@ -161,9 +162,8 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine
etgc->n = n;
etgc->ascending = column.ascending;
- etgc->font = gtk_style_get_font (GTK_WIDGET (GNOME_CANVAS_ITEM (etgc)->canvas)->style);
-
- gdk_font_ref (etgc->font);
+ style = GTK_WIDGET (GNOME_CANVAS_ITEM (etgc)->canvas)->style;
+ etgc->font_desc = pango_font_description_copy (style->font_desc);
etgc->open = TRUE;
}
@@ -1006,8 +1006,18 @@ etgc_reflow (GnomeCanvasItem *item, gint flags)
gdouble item_height = 0;
gdouble item_width = 0;
- if (etgc->font)
- extra_height += etgc->font->ascent + etgc->font->descent + BUTTON_PADDING * 2;
+ if (etgc->font_desc) {
+ PangoContext *context;
+ PangoFontMetrics *metrics;
+
+ context = gtk_widget_get_pango_context (GTK_WIDGET (etgc));
+ metrics = pango_context_get_metrics (context, etgc->font_desc, NULL);
+ extra_height +=
+ pango_font_metrics_get_ascent (metrics) +
+ pango_font_metrics_get_descent (metrics) +
+ BUTTON_PADDING * 2;
+ pango_font_metrics_unref (metrics);
+ }
extra_height = MAX(extra_height, BUTTON_HEIGHT + BUTTON_PADDING * 2);