aboutsummaryrefslogtreecommitdiffstats
path: root/embed/webkit/webkit-embed-prefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'embed/webkit/webkit-embed-prefs.c')
-rw-r--r--embed/webkit/webkit-embed-prefs.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/embed/webkit/webkit-embed-prefs.c b/embed/webkit/webkit-embed-prefs.c
index a0cc23dee..e9193be34 100644
--- a/embed/webkit/webkit-embed-prefs.c
+++ b/embed/webkit/webkit-embed-prefs.c
@@ -134,11 +134,49 @@ webkit_pref_callback_user_stylesheet (GConfClient *client,
g_free (uri);
}
+static void
+webkit_pref_callback_font_size (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer data)
+{
+ GConfValue *gcvalue;
+ char *webkit_pref = data;
+ const char *value = NULL;
+ int size = 9; /* FIXME: What to use here? */
+
+ gcvalue = gconf_entry_get_value (entry);
+
+ /* happens on initial notify if the key doesn't exist */
+ if (gcvalue != NULL &&
+ gcvalue->type == GCONF_VALUE_STRING) {
+ value = gconf_value_get_string (gcvalue);
+ }
+
+ if (value) {
+ PangoFontDescription* desc;
+
+ desc = pango_font_description_from_string (value);
+ size = pango_font_description_get_size (desc);
+ if (pango_font_description_get_size_is_absolute (desc) == FALSE)
+ size /= PANGO_SCALE;
+ pango_font_description_free (desc);
+ }
+
+ g_object_set (settings, webkit_pref, size, NULL);
+}
+
static const PrefData webkit_pref_entries[] =
{
{ CONF_RENDERING_FONT_MIN_SIZE,
"minimum-font-size",
webkit_pref_callback_int },
+ { CONF_DESKTOP_FONT_VAR_SIZE,
+ "default-font-size",
+ webkit_pref_callback_font_size },
+ { CONF_DESKTOP_FONT_FIXED_SIZE,
+ "default-monospace-font-size",
+ webkit_pref_callback_font_size },
{ CONF_SECURITY_JAVASCRIPT_ENABLED,
"enable-scripts",
webkit_pref_callback_boolean },