diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-09-18 20:06:48 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-09-18 20:06:48 +0000 |
commit | a15d5c36f6e100ff512ca3fc2ff034d3cbd5f572 (patch) | |
tree | 977167ee56376a78020bac27816be830a5c04e00 /gtk/gtkclist.c | |
parent | c45ee0bf85dd61abb6a8469265274c2265772af9 (diff) | |
download | gdk-pixbuf-a15d5c36f6e100ff512ca3fc2ff034d3cbd5f572.tar.gz |
Fix up for changes to PangoFontDescription.
Wed Sep 12 11:21:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.[ch] gtk/gtktexttag.[ch]
gtk/gtktextview.c tests/testgtk.c: Fix up for changes to
PangoFontDescription.
* gtk/gtkentry.c gtk/gtkclist.c gtk/gtkcellrenderertext.c
gtk/gtkspinbutton.c: Fix up for change to PangoMetrics
structure.
* gtk/gtkfontsel.c: Fix up for new Pango font listing API.
* gtk/gtkstyle.[ch]: Add gtk_style_get_font/set_font to replace
direct access to style->font. Deprecate gtk_style_ref/unref.
* gtk/gtkclist.c gtk/gtkctree.c gtk/gtkstyle.c gtk/gtkwidget.c:
Remove gtk_style_ref/unref with g_object_ref/unref.
* gtk/gtkcalendar.c: Remove leftover macros accessing
style->font.
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): Remove unused
variable.
* gtk/gtktext.c gtk/gtklabel.c: Use gtk_style_get_font() instead of
style->font.
Diffstat (limited to 'gtk/gtkclist.c')
-rw-r--r-- | gtk/gtkclist.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 874f9c72b..2ea8aa7e2 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -3052,15 +3052,20 @@ gtk_clist_set_row_height (GtkCList *clist, if (widget->style->font_desc) { PangoContext *context = gtk_widget_get_pango_context (widget); - PangoFontMetrics metrics; + PangoFontMetrics *metrics; - pango_context_get_metrics (context, - widget->style->font_desc, - pango_context_get_language (context), - &metrics); + metrics = pango_context_get_metrics (context, + widget->style->font_desc, + pango_context_get_language (context)); if (!GTK_CLIST_ROW_HEIGHT_SET(clist)) - clist->row_height = PANGO_PIXELS (metrics.ascent + metrics.descent); + { + clist->row_height = (pango_font_metrics_get_ascent (metrics) + + pango_font_metrics_get_descent (metrics)); + clist->row_height = PANGO_PIXELS (clist->row_height); + } + + pango_font_metrics_unref (metrics); } CLIST_REFRESH (clist); @@ -3294,14 +3299,14 @@ gtk_clist_set_cell_style (GtkCList *clist, { if (GTK_WIDGET_REALIZED (clist)) gtk_style_detach (clist_row->cell[column].style); - gtk_style_unref (clist_row->cell[column].style); + g_object_unref (clist_row->cell[column].style); } clist_row->cell[column].style = style; if (clist_row->cell[column].style) { - gtk_style_ref (clist_row->cell[column].style); + g_object_ref (clist_row->cell[column].style); if (GTK_WIDGET_REALIZED (clist)) clist_row->cell[column].style = @@ -3373,14 +3378,14 @@ gtk_clist_set_row_style (GtkCList *clist, { if (GTK_WIDGET_REALIZED (clist)) gtk_style_detach (clist_row->style); - gtk_style_unref (clist_row->style); + g_object_unref (clist_row->style); } clist_row->style = style; if (clist_row->style) { - gtk_style_ref (clist_row->style); + g_object_ref (clist_row->style); if (GTK_WIDGET_REALIZED (clist)) clist_row->style = gtk_style_attach (clist_row->style, @@ -6323,7 +6328,7 @@ row_delete (GtkCList *clist, { if (GTK_WIDGET_REALIZED (clist)) gtk_style_detach (clist_row->cell[i].style); - gtk_style_unref (clist_row->cell[i].style); + g_object_unref (clist_row->cell[i].style); } } @@ -6331,7 +6336,7 @@ row_delete (GtkCList *clist, { if (GTK_WIDGET_REALIZED (clist)) gtk_style_detach (clist_row->style); - gtk_style_unref (clist_row->style); + g_object_unref (clist_row->style); } if (clist_row->destroy) |