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/gtktext.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/gtktext.c')
-rw-r--r-- | gtk/gtktext.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 4ab3b453b..f57309197 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -72,7 +72,7 @@ #define MARK_CURRENT_FONT(text, mark) \ ((MARK_CURRENT_PROPERTY(mark)->flags & PROPERTY_FONT) ? \ MARK_CURRENT_PROPERTY(mark)->font->gdk_font : \ - GTK_WIDGET (text)->style->font) + gtk_style_get_font (GTK_WIDGET (text)->style)) #define MARK_CURRENT_FORE(text, mark) \ ((MARK_CURRENT_PROPERTY(mark)->flags & PROPERTY_FOREGROUND) ? \ &MARK_CURRENT_PROPERTY(mark)->fore_color : \ @@ -985,7 +985,7 @@ gtk_text_insert (GtkText *text, GtkWidget *widget; widget = GTK_WIDGET (text); gtk_widget_ensure_style (widget); - if ((widget->style) && (widget->style->font->type == GDK_FONT_FONTSET)) + if ((widget->style) && (gtk_style_get_font (widget->style)->type == GDK_FONT_FONTSET)) { text->use_wchar = TRUE; g_free (text->text.ch); @@ -1392,7 +1392,7 @@ gtk_text_style_set (GtkWidget *widget, if (text->current_font) text_font_unref (text->current_font); - text->current_font = get_text_font (widget->style->font); + text->current_font = get_text_font (gtk_style_get_font (widget->style)); } static void @@ -1544,6 +1544,7 @@ static void gtk_text_size_request (GtkWidget *widget, GtkRequisition *requisition) { + GdkFont *font; gint xthickness; gint ythickness; gint char_height; @@ -1554,11 +1555,13 @@ gtk_text_size_request (GtkWidget *widget, xthickness = widget->style->xthickness + TEXT_BORDER_ROOM; ythickness = widget->style->ythickness + TEXT_BORDER_ROOM; + + font = gtk_style_get_font (widget->style); - char_height = MIN_TEXT_HEIGHT_LINES * (widget->style->font->ascent + - widget->style->font->descent); + char_height = MIN_TEXT_HEIGHT_LINES * (font->ascent + + font->descent); - char_width = MIN_TEXT_WIDTH_LINES * (gdk_text_width (widget->style->font, + char_width = MIN_TEXT_WIDTH_LINES * (gdk_text_width (font, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26) / 26); |