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

From: Christoph Lohmann <20h_AT_r-36.net>
Date: Sat, 16 Feb 2013 16:23:23 +0100

Greetings.

On Sat, 16 Feb 2013 16:23:23 +0100 stanio_AT_cs.tu-berlin.de wrote:
> * 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.

I think having many kind of stylefiles is too complex for the mainline.
The toggling has a relevance, but your »code.txt« should be a patch on
the wiki site of surf.


Sincerely,

Christoph Lohmann
Received on Sat Feb 16 2013 - 16:23:23 CET

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