aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-12-08 02:51:11 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-12-08 23:56:12 +0800
commit4015281028a036ee859360bb7feb3a6aeb8f56cb (patch)
treef9d8b7f71a4229d8b44d1180698e8f892635e880 /src
parentbc03f56a7483e499274cf1632975dfbb7e09e9ec (diff)
downloadgsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.tar
gsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.tar.gz
gsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.tar.bz2
gsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.tar.lz
gsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.tar.xz
gsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.tar.zst
gsoc2013-epiphany-4015281028a036ee859360bb7feb3a6aeb8f56cb.zip
prefs-dialog: new custom font selection UI
Allow users to set custom sans, serif and monospace fonts if they don't want the defaults, which are the desktop wide settings in the org.gnome.desktop.interface schema. Bug #636761
Diffstat (limited to 'src')
-rw-r--r--src/prefs-dialog.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index ce9466a08..44946c6fb 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1038,6 +1038,9 @@ static const PrefsDialogPreference preferences[] =
{ "disk_cache_spinbutton", "value",
EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_CACHE_SIZE,
G_SETTINGS_BIND_DEFAULT, NULL, NULL },
+ { "use_gnome_fonts_checkbutton", "active",
+ EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_USE_GNOME_FONTS,
+ G_SETTINGS_BIND_DEFAULT, NULL, NULL },
{ "use_fonts_checkbutton", "active",
EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_USE_OWN_FONTS,
G_SETTINGS_BIND_DEFAULT, NULL, NULL },
@@ -1061,6 +1064,21 @@ static const PrefsDialogPreference preferences[] =
G_SETTINGS_BIND_DEFAULT, NULL, NULL },
{ "css_edit_button", "sensitive",
EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_ENABLE_USER_CSS,
+ G_SETTINGS_BIND_GET, NULL, NULL },
+
+ /* Font buttons */
+ { "custom_fonts_vbox", "sensitive",
+ EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_USE_GNOME_FONTS,
+ G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN, NULL, NULL },
+
+ { "sans_fontbutton", "font-name",
+ EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_SANS_SERIF_FONT,
+ G_SETTINGS_BIND_DEFAULT, NULL, NULL },
+ { "serif_fontbutton", "font-name",
+ EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_SERIF_FONT,
+ G_SETTINGS_BIND_DEFAULT, NULL, NULL },
+ { "mono_fontbutton", "font-name",
+ EPHY_PREFS_WEB_SCHEMA, EPHY_PREFS_WEB_MONOSPACE_FONT,
G_SETTINGS_BIND_DEFAULT, NULL, NULL },
/* Has mapping */
@@ -1102,12 +1120,17 @@ prefs_dialog_init (PrefsDialog *pd)
settings = ephy_settings_get (pref.schema);
widget = ephy_dialog_get_control (dialog, pref.obj);
- g_settings_bind_with_mapping (settings, pref.key,
- widget, pref.prop,
- pref.flags,
- pref.get_mapping,
- pref.set_mapping,
- widget, NULL);
+ if (pref.set_mapping != NULL || pref.get_mapping != NULL)
+ g_settings_bind_with_mapping (settings, pref.key,
+ widget, pref.prop,
+ pref.flags,
+ pref.get_mapping,
+ pref.set_mapping,
+ widget, NULL);
+ else
+ g_settings_bind (settings, pref.key,
+ widget, pref.prop,
+ pref.flags);
}
ephy_dialog_get_controls (dialog,