diff options
-rw-r--r-- | src/application.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/application.c b/src/application.c index 0cf19c4..fa7ec90 100644 --- a/src/application.c +++ b/src/application.c @@ -29,17 +29,20 @@ #include "about.h" #include "window.h" -MqApplication * -mq_application_new(gchar __attribute__((unused)) *profile, - gboolean __attribute__((unused)) private) +#define GET_BOOL(MQ_NAME) mq_config_get_boolean(application->config, MQ_NAME) +#define MAP_BOOL( WK_NAME, MQ_NAME) WK_NAME, GET_BOOL(MQ_NAME) +#define MAP_BOOL_N(WK_NAME, MQ_NAME) WK_NAME, GET_BOOL(MQ_NAME) + +static void +set_webkit_settings(MqApplication *application) { - MqApplication *application; + WebKitSettings *settings; WebKitWebContext *web_context; - application = malloc(sizeof(*application)); - application->config = mq_config_new("default"); - mq_config_load(application->config); - application->windows = NULL; + settings = webkit_settings_new_with_settings( + MAP_BOOL("enable-smooth-scrolling", + "navigation.smooth-scrolling"), + NULL); web_context = webkit_web_context_get_default(); webkit_web_context_set_favicon_database_directory(web_context, NULL); @@ -48,6 +51,24 @@ mq_application_new(gchar __attribute__((unused)) *profile, webkit_web_context_register_uri_scheme(web_context, "mq-about", (WebKitURISchemeRequestCallback) mq_about_request, application, NULL); +} + +#undef GET_BOOL +#undef MAP_BOOL +#undef MAP_BOOL_N + +MqApplication * +mq_application_new(gchar __attribute__((unused)) *profile, + gboolean __attribute__((unused)) private) +{ + MqApplication *application; + + application = malloc(sizeof(*application)); + application->config = mq_config_new("default"); + mq_config_load(application->config); + application->windows = NULL; + + set_webkit_settings(application); return application; } |