diff options
author | nyamatongwe <devnull@localhost> | 2003-08-21 13:30:53 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2003-08-21 13:30:53 +0000 |
commit | 1932f6fadabd1b5b42a1c9933d70abcb4dcd0ab1 (patch) | |
tree | 5b5a9ff42446ec29f2fe23642d11000e424d5b7d | |
parent | 3bb0f97093d47d62956ac9703660de9b0c1b1d67 (diff) | |
download | scintilla-mirror-1932f6fadabd1b5b42a1c9933d70abcb4dcd0ab1.tar.gz |
List boxes now display with same font as current style when
that font is a Pango font.
-rw-r--r-- | gtk/PlatGTK.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
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 } |