[Webkit-unassigned] [Bug 126907] [GTK] Hardcoded text color in input fields

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 29 02:50:34 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=126907

--- Comment #58 from Benjamin Otte <otte at gnome.org> ---
(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;
}

-- 
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/20180529/1aec64e6/attachment-0001.html>


More information about the webkit-unassigned mailing list