aboutsummaryrefslogtreecommitdiffstats
path: root/embed/webkit/webkit-embed-prefs.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-04-22 00:31:33 +0800
committerXan Lopez <xan@gnome.org>2009-04-22 00:31:33 +0800
commitb7f534ac95a7d1fce61884286f0da067e67627e4 (patch)
tree11cd9312589c09283fc03fbeb06c849574eef80b /embed/webkit/webkit-embed-prefs.c
parent64ca17c616475c10e7d5ceb61c544b63f8b40165 (diff)
downloadgsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.tar
gsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.tar.gz
gsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.tar.bz2
gsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.tar.lz
gsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.tar.xz
gsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.tar.zst
gsoc2013-epiphany-b7f534ac95a7d1fce61884286f0da067e67627e4.zip
Use GNOME settings for default font sizes.
We were using WebKitGTK+ defaults now.
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 },