gtk.css_provider
Module for [CssProvider] class
Types 3
GtkCssProvider is an object implementing the #GtkStyleProvider interface. It is able to parse [CSS-like][css-overview] input in order to style widgets.
An application can make GTK+ parse a specific CSS style sheet by calling [gtk.css_provider.CssProvider.loadFromFile] or [gtk.css_provider.CssProvider.loadFromResource] and adding the provider with [gtk.style_context.StyleContext.addProvider] or [gtk.style_context.StyleContext.addProviderForScreen].
In addition, certain files will be read when GTK+ is initialized. First, the file $XDG_CONFIG_HOME/gtk-3.0/gtk.css is loaded if it exists. Then, GTK+ loads the first existing file among XDG_DATA_HOME/themes/THEME/gtk-VERSION/gtk.css, $HOME/.themes/THEME/gtk-VERSION/gtk.css, $XDG_DATA_DIRS/themes/THEME/gtk-VERSION/gtk.css and DATADIR/share/themes/THEME/gtk-VERSION/gtk.css, where THEME is the name of the current theme (see the #GtkSettings:gtk-theme-name setting), DATADIR is the prefix configured when GTK+ was compiled (unless overridden by the GTK_DATA_PREFIX environment variable), and VERSION is the GTK+ version number. If no file is found for the current version, GTK+ tries older versions all the way back to 3.0.
In the same way, GTK+ tries to load a gtk-keys.css file for the current key theme, as defined by #GtkSettings:gtk-key-theme-name.
CssProvider self()Returns `this`, for use in `with` statements.CssProviderGidBuilder builder()Get builder for [gtk.css_provider.CssProvider] Returns: New builder objectgtk.css_provider.CssProvider getDefault()Returns the provider containing the style settings used as a fallback for all widgets. Returns: The provider used for fallback styling. This memory is owned by GTK+, and you must not free it.gtk.css_provider.CssProvider getNamed(string name, string variant = null)Loads a theme from the usual theme pathsbool loadFromData(ubyte[] data)Loads data into css_provider, and by doing so clears any previously loaded information.bool loadFromFile(gio.file.File file)Loads the data contained in file into css_provider, making it clear any previously loaded information.bool loadFromPath(string path)Loads the data contained in path into css_provider, making it clear any previously loaded information.void loadFromResource(string resourcePath)Loads the data contained in the resource at resource_path into the #GtkCssProvider, clearing any previously loaded information.string toString_()Converts the provider into a string representation in CSS format.gulong connectParsingError(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.css_section.CssSection)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == glib.error.ErrorWrap)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.css_provider.CssProvider)))
&& Parameters!T.length < 4)Connect to `ParsingError` signal.Fluent builder for [gtk.css_provider.CssProvider]