diff options
Diffstat (limited to 'components/text/nautilus-text-view.c')
-rw-r--r-- | components/text/nautilus-text-view.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/components/text/nautilus-text-view.c b/components/text/nautilus-text-view.c index 02e88ede9..17d875e2a 100644 --- a/components/text/nautilus-text-view.c +++ b/components/text/nautilus-text-view.c @@ -31,6 +31,7 @@ #include <string.h> #include <eel/eel-debug.h> #include <eel/eel-vfs-extensions.h> +#include <gconf/gconf-client.h> #include <gtk/gtktextview.h> #include <gtk/gtkscrolledwindow.h> #include <libnautilus/nautilus-view.h> @@ -183,11 +184,26 @@ nautilus_text_view_instance_init (NautilusTextView *view) { GtkWidget *text_view; GtkWidget *scrolled_window; + PangoFontDescription *monospace_font_desc; + GConfClient *conf_client; + char *monospace_font; text_view = gtk_text_view_new (); gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD); - + gtk_text_view_set_left_margin (GTK_TEXT_VIEW (text_view), 3); + gtk_text_view_set_right_margin (GTK_TEXT_VIEW (text_view), 3); + + /* Pick up the monospace font from desktop preferences */ + conf_client = gconf_client_get_default (); + monospace_font = gconf_client_get_string (conf_client, "/desktop/gnome/interface/monospace_font_name", NULL); + if (monospace_font) { + monospace_font_desc = pango_font_description_from_string (monospace_font); + gtk_widget_modify_font (text_view, monospace_font_desc); + pango_font_description_free (monospace_font_desc); + } + g_object_unref (conf_client); + scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, |