[Webkit-unassigned] [Bug 126907] [GTK] Hardcoded text color in input fields
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed May 30 07:05:54 PDT 2018
https://bugs.webkit.org/show_bug.cgi?id=126907
--- Comment #60 from Carlos Eduardo Ramalho <cadubentzen at gmail.com> ---
(In reply to Benjamin Otte from comment #58)
> (In reply to Carlos Eduardo Ramalho from comment #55)
> > I tried adding it with G_TYPE_NONE but then the problem with HighContrast
> > comes back.
> >
>
> You'd need something like this I think:
>
> static GRefPtr<GtkStyleContext> createBaseStyleContext()
> {
> GRefPtr<GtkWidgetPath> path = adoptGRef(gtk_widget_path_new());
> gtk_widget_path_append_type(path.get(), GTK_TYPE_WINDOW);
> gtk_widget_path_iter_set_object_name(path.get(), -1, "window");
> gtk_widget_path_iter_add_class(path.get(), -1,
> GTK_STYLE_CLASS_BACKGROUND);
>
> GRefPtr<GtkStyleContext> windowContext =
> adoptGRef(gtk_style_context_new());
> gtk_style_context_set_path(windowContext.get(), path.get());
> gtk_style_context_set_parent(windowContext.get(), nullptr);
>
> path = adoptGRef(gtk_widget_path_new());
> gtk_widget_path_append_type(path.get(), GTK_TYPE_WINDOW);
> gtk_widget_path_iter_set_object_name(path.get(), -1, "window");
> gtk_widget_path_iter_add_class(path.get(), -1,
> GTK_STYLE_CLASS_BACKGROUND);
>
> gtk_widget_path_append_type(path.get(), G_TYPE_NONE);
> gtk_widget_path_iter_set_object_name(path.get(), -1, "webview");
>
> GRefPtr<GtkStyleContext> baseContext =
> adoptGRef(gtk_style_context_new());
> gtk_style_context_set_path(baseContext.get(), path.get());
> gtk_style_context_set_parent(baseContext.get(), windowContext.get());
>
> return baseContext;
> }
Your suggestion solved the problems I was having. Thanks! However I got some weird results when testing theme customizations, so I'll leave it to another patch for now as it was not the original topic of this bug.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180530/a69d0c9b/attachment.html>
More information about the webkit-unassigned
mailing list