diff options
author | Alexander Larsson <alexl@redhat.com> | 2003-02-28 11:23:43 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2003-02-28 11:23:43 +0000 |
commit | 48c4c00431dbcaecdf05552c390d6fe908e678b4 (patch) | |
tree | da1aff22d5a27d707be1d60ecda05241adb86a46 | |
parent | e4305677f274c0164204fe9c3637c67f05bb0d77 (diff) | |
download | nautilus-48c4c00431dbcaecdf05552c390d6fe908e678b4.tar.gz |
Use monospaced font for text view. Patch by Luca Ferretti
2003-02-28 Alexander Larsson <alexl@redhat.com>
* components/text/nautilus-text-view.c (nautilus_text_view_instance_init):
Use monospaced font for text view.
Patch by Luca Ferretti <elle.uca@libero.it>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | components/text/nautilus-text-view.c | 18 |
2 files changed, 23 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2003-02-28 Alexander Larsson <alexl@redhat.com> + * components/text/nautilus-text-view.c (nautilus_text_view_instance_init): + Use monospaced font for text view. + Patch by Luca Ferretti <elle.uca@libero.it> + +2003-02-28 Alexander Larsson <alexl@redhat.com> + * src/nautilus-file-management-properties.c: * src/nautilus-file-management-properties.glade: Add a 1 GB value for the thumbnailing limit. 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, |