Re: [dev] [surf] patch for style toggling

From: <stanio_AT_cs.tu-berlin.de>
Date: Sat, 16 Feb 2013 15:34:58 +0100

* Nick 2013-02-16 15:12
> +static void
> +togglestyle(Client *c, const Arg *arg) {
> + WebKitWebSettings *settings;
> + char *uri;
> +
> + settings = webkit_web_view_get_settings(c->view);
> + g_object_get(G_OBJECT(settings), "user-stylesheet-uri", &uri, NULL);
> + uri = uri[0] ? g_strdup("") : g_strconcat("file://", stylefile, NULL);
> + g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
> +
> + update(c);
> +}

I use this all the time, slightly differently though. I have "text
styles" for "day" and "night" since the light conditions make difference
for convinient reading. You seem to ignore the Arg function argument,
which I use for saying which stylw. In combination with a modified
simplyread() Javascript heurisic someone posted here a while ago,
browsing is ok.

Attached the relevant code.

cheers
--s.

Received on Sat Feb 16 2013 - 15:34:58 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 21 2013 - 19:23:00 CET