From 1932f6fadabd1b5b42a1c9933d70abcb4dcd0ab1 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 21 Aug 2003 13:30:53 +0000 Subject: List boxes now display with same font as current style when that font is a Pango font. --- gtk/PlatGTK.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 275e2c40d..dafbd4e66 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1627,7 +1627,7 @@ void Window::InvalidateRectangle(PRectangle rc) { } void Window::SetFont(Font &) { - // TODO + // Can not be done generically but only needed for ListBox } void Window::SetCursor(Cursor curs) { @@ -1802,14 +1802,22 @@ void ListBoxX::SetFont(Font &scint_font) { } #else GtkStyle *styleCurrent = gtk_widget_get_style(GTK_WIDGET(PWidget(list))); - GdkFont *fontCurrent = gtk_style_get_font(styleCurrent); if (PFont(scint_font)->pfont) { + // Current font is GDK font + GdkFont *fontCurrent = gtk_style_get_font(styleCurrent); if (!gdk_font_equal(fontCurrent, PFont(scint_font)->pfont)) { GtkStyle *styleNew = gtk_style_copy(styleCurrent); gtk_style_set_font(styleNew, PFont(scint_font)->pfont); gtk_widget_set_style(GTK_WIDGET(PWidget(list)), styleNew); gtk_style_unref(styleCurrent); } + } else if (PFont(scint_font)->pfd) { + // Current font is Pango font + GtkStyle *styleNew = gtk_style_copy(styleCurrent); + pango_font_description_free(styleNew->font_desc); + styleNew->font_desc = pango_font_description_copy(PFont(scint_font)->pfd); + gtk_widget_set_style(GTK_WIDGET(PWidget(list)), styleNew); + gtk_style_unref(styleCurrent); } #endif } -- cgit v1.2.3