summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2006-08-17 20:31:24 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2006-08-17 20:31:24 +0000
commit9203dacfac5f84bfe8fd1fac704b59c8802fe150 (patch)
treeb13cccb07a1319a0775f5a79c11df013dee90c5a /gtk
parentf90d6dfb25cbbf7d0e9ff1aa4e4cf3fc2f5385fd (diff)
downloadnetsurf-9203dacfac5f84bfe8fd1fac704b59c8802fe150.tar.gz
netsurf-9203dacfac5f84bfe8fd1fac704b59c8802fe150.tar.bz2
Added font selection to nsgtk choices window. Still not used for plotting.
svn path=/trunk/netsurf/; revision=2862
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk_options.c13
-rw-r--r--gtk/netsurf.glade5
2 files changed, 13 insertions, 5 deletions
diff --git a/gtk/gtk_options.c b/gtk/gtk_options.c
index 033d18115..4f236ee6f 100644
--- a/gtk/gtk_options.c
+++ b/gtk/gtk_options.c
@@ -106,6 +106,7 @@ void nsgtk_options_init(void) {
#define SET_SPIN(x, y) gtk_spin_button_set_value(GTK_SPIN_BUTTON((x)), (y))
#define SET_CHECK(x, y) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON((x)), (y))
#define SET_COMBO(x, y) gtk_combo_box_set_active(GTK_COMBO_BOX((x)), (y))
+#define SET_FONT(x, y) gtk_font_button_set_font_name(GTK_FONT_BUTTON((x)), (y))
void nsgtk_options_load(void) {
char b[20];
@@ -131,6 +132,11 @@ void nsgtk_options_load(void) {
SET_CHECK(checkDisableAnimations, !option_animate_images);
/* TODO: set all font name widgets here */
+ SET_FONT(fontSansSerif, option_font_sans);
+ SET_FONT(fontSerif, option_font_serif);
+ SET_FONT(fontMonospace, option_font_mono);
+ SET_FONT(fontCursive, option_font_cursive);
+ SET_FONT(fontFantasy, option_font_fantasy);
SET_COMBO(comboDefault, option_font_default - 1);
SET_SPIN(spinDefaultSize, option_font_size / 10);
SET_SPIN(spinMinimumSize, option_font_min_size / 10);
@@ -144,6 +150,8 @@ void nsgtk_options_load(void) {
#define GET_CHECK(x, y) (y) = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON((x)))
#define GET_SPIN(x, y) (y) = gtk_spin_button_get_value(GTK_SPIN_BUTTON((x)))
#define GET_COMBO(x, y) (y) = gtk_combo_box_get_active(GTK_COMBO_BOX((x)))
+#define GET_FONT(x, y) if ((y)) free((y)); \
+ (y) = strdup(gtk_font_button_get_font_name(GTK_FONT_BUTTON((x))))
void nsgtk_options_save(void) {
GET_ENTRY(entryHomePageURL, option_homepage_url);
@@ -152,6 +160,11 @@ void nsgtk_options_save(void) {
GET_CHECK(checkUseCairo, option_render_cairo);
GET_CHECK(checkResampleImages, option_render_resample);
+ GET_FONT(fontSansSerif, option_font_sans);
+ GET_FONT(fontSerif, option_font_serif);
+ GET_FONT(fontMonospace, option_font_mono);
+ GET_FONT(fontCursive, option_font_cursive);
+ GET_FONT(fontFantasy, option_font_fantasy);
GET_COMBO(comboDefault, option_font_default);
option_font_default++;
diff --git a/gtk/netsurf.glade b/gtk/netsurf.glade
index 952413132..1fb0fa0a7 100644
--- a/gtk/netsurf.glade
+++ b/gtk/netsurf.glade
@@ -3466,7 +3466,6 @@ NTML authentication</property>
<child>
<widget class="GtkFontButton" id="fontSerif">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">False</property>
@@ -3487,7 +3486,6 @@ NTML authentication</property>
<child>
<widget class="GtkFontButton" id="fontMonospace">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">False</property>
@@ -3508,7 +3506,6 @@ NTML authentication</property>
<child>
<widget class="GtkFontButton" id="fontCursive">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">False</property>
@@ -3529,7 +3526,6 @@ NTML authentication</property>
<child>
<widget class="GtkFontButton" id="fontFantasy">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">False</property>
@@ -3571,7 +3567,6 @@ Fantasy</property>
<child>
<widget class="GtkFontButton" id="fontSansSerif">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">False</property>