about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-07-25 16:09:53 +0000
committerMarco Peereboom <marco@conformal.com>2011-07-25 16:09:53 +0000
commit88b52fe5333154979d27a49668f3b462c7a417a8 (patch)
tree54622fc555f5cab1907ce2cb0324942b7a4ef37d
parent67e653d1b9cee283275881d4fac410843f89a621 (diff)
downloadxombrero-88b52fe5333154979d27a49668f3b462c7a417a8.tar.gz
add more settable fonts
From: Michal Mazurek <akfaew@jasminek.net>
-rw-r--r--xxxterm.18
-rw-r--r--xxxterm.c15
-rw-r--r--xxxterm.conf2
3 files changed, 24 insertions, 1 deletions
diff --git a/xxxterm.1 b/xxxterm.1
index a3e3f26..ecb56cb 100644
--- a/xxxterm.1
+++ b/xxxterm.1
@@ -831,6 +831,10 @@ When
 is use the file will be downloaded to the
 .Pa download_dir
 before the MIME handler is called.
+.It Cm oops_font
+Set the font used to display error messages.
+E.g.
+.Pa oops_font = monospace normal 9 .
 .It Cm read_only_cookies
 Mark cookies file read-only and discard all cookies once the session is
 terminated.
@@ -912,6 +916,10 @@ for an alternative.
 You can switch the tab style with the
 .Pa tabnextstyle
 command.
+.It Cm tabbar_font
+Set the compact tab bar font.
+E.g.
+.Pa tabbar_font = monospace normal 9 .
 .It Cm user_agent
 Set to override the default
 .Nm
diff --git a/xxxterm.c b/xxxterm.c
index b8df224..cec3c96 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -540,9 +540,13 @@ gint		enable_spell_checking = 0;
 char		*spell_check_languages = NULL;
 
 char		*cmd_font_name = NULL;
+char		*oops_font_name = NULL;
 char		*statusbar_font_name = NULL;
+char		*tabbar_font_name = NULL;
 PangoFontDescription *cmd_font;
+PangoFontDescription *oops_font;
 PangoFontDescription *statusbar_font;
+PangoFontDescription *tabbar_font;
 
 int			btn_down;	/* M1 down in any wv */
 
@@ -707,7 +711,9 @@ struct settings {
 
 	/* font settings */
 	{ "cmd_font",			XT_S_STR, 0, NULL, &cmd_font_name, NULL },
+	{ "oops_font",			XT_S_STR, 0, NULL, &oops_font_name, NULL },
 	{ "statusbar_font",		XT_S_STR, 0, NULL, &statusbar_font_name, NULL },
+	{ "tabbar_font",		XT_S_STR, 0, NULL, &tabbar_font_name, NULL },
 
 	/* runtime settings */
 	{ "alias",			XT_S_STR, XT_SF_RUNTIME, NULL, NULL, &s_alias },
@@ -7746,6 +7752,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 	gdk_color_parse(XT_COLOR_RED, &color);
 	gtk_widget_modify_base(t->oops, GTK_STATE_NORMAL, &color);
 	gtk_box_pack_end(GTK_BOX(t->vbox), t->oops, FALSE, FALSE, 0);
+	gtk_widget_modify_font(GTK_WIDGET(t->oops), oops_font);
 
 	/* command entry */
 	t->cmd = gtk_entry_new();
@@ -7761,12 +7768,13 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 	gtk_entry_set_inner_border(GTK_ENTRY(t->sbe.statusbar), NULL);
 	gtk_entry_set_has_frame(GTK_ENTRY(t->sbe.statusbar), FALSE);
 	gtk_widget_set_can_focus(GTK_WIDGET(t->sbe.statusbar), FALSE);
+	gtk_widget_modify_font(GTK_WIDGET(t->sbe.statusbar), statusbar_font);
 
 	t->sbe.position = gtk_entry_new();
 	gtk_entry_set_inner_border(GTK_ENTRY(t->sbe.position), NULL);
 	gtk_entry_set_has_frame(GTK_ENTRY(t->sbe.position), FALSE);
 	gtk_widget_set_can_focus(GTK_WIDGET(t->sbe.position), FALSE);
-
+	gtk_widget_modify_font(GTK_WIDGET(t->sbe.position), statusbar_font);
 	gtk_entry_set_alignment(GTK_ENTRY(t->sbe.position), 1.0);
 	gtk_widget_set_size_request(t->sbe.position, 40, -1);
 
@@ -7803,6 +7811,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 	gtk_label_set_width_chars(GTK_LABEL(t->tab_elems.label), 1.0);
 	gtk_misc_set_alignment(GTK_MISC(t->tab_elems.label), 0.0, 0.0);
 	gtk_misc_set_padding(GTK_MISC(t->tab_elems.label), 4.0, 4.0);
+	gtk_widget_modify_font(GTK_WIDGET(t->tab_elems.label), tabbar_font);
 
 	t->tab_elems.eventbox = gtk_event_box_new();
 	t->tab_elems.box = gtk_hbox_new(FALSE, 0);
@@ -8808,7 +8817,9 @@ main(int argc, char *argv[])
 	resource_dir = g_strdup("/usr/local/share/xxxterm/");
 	strlcpy(runtime_settings, "runtime", sizeof runtime_settings);
 	cmd_font_name = g_strdup("monospace normal 9");
+	oops_font_name = g_strdup("monospace normal 9");
 	statusbar_font_name = g_strdup("monospace normal 9");
+	tabbar_font_name = g_strdup("monospace normal 9");
 
 
 	/* read config file */
@@ -8819,7 +8830,9 @@ main(int argc, char *argv[])
 
 	/* init fonts */
 	cmd_font = pango_font_description_from_string(cmd_font_name);
+	oops_font = pango_font_description_from_string(oops_font_name);
 	statusbar_font = pango_font_description_from_string(statusbar_font_name);
+	tabbar_font = pango_font_description_from_string(tabbar_font_name);
 
 	/* working directory */
 	if (strlen(work_dir) == 0)
diff --git a/xxxterm.conf b/xxxterm.conf
index c64b473..da611d9 100644
--- a/xxxterm.conf
+++ b/xxxterm.conf
@@ -36,7 +36,9 @@
 # max_connections	= 25
 
 # cmd_font		= monospace normal 9
+# oops_font		= monospace normal 9
 # statusbar_font	= monospace normal 9
+# tabbar_font		= monospace normal 9
 
 #
 # resource_dir		= /usr/local/share/xxxterm/