Class: Gtk::CssProvider
- Inherits:
-
Object
- Object
- Gtk::CssProvider
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#initialize ⇒ Gtk::CssProvider
constructor
Returns a newly created
GtkCssProvider. -
#load_from_bytes(data) ⇒ nil
Loads data into css_provider.
-
#load_from_data(data, length) ⇒ nil
Loads data into css_provider.
-
#load_from_file(file) ⇒ nil
Loads the data contained in file into css_provider.
-
#load_from_path(path) ⇒ nil
Loads the data contained in path into css_provider.
-
#load_from_resource(resource_path) ⇒ nil
Loads the data contained in the resource at resource_path into the css_provider.
-
#load_from_string(string) ⇒ nil
Loads string into css_provider.
-
#load_named(name, variant) ⇒ nil
Loads a theme from the usual theme paths.
-
#prefers_color_scheme ⇒ Gtk::InterfaceColorScheme
Define the color scheme used for rendering the user interface.
-
#prefers_color_scheme=(prefers_color_scheme) ⇒ Gtk::InterfaceColorScheme
Define the color scheme used for rendering the user interface.
-
#prefers_contrast ⇒ Gtk::InterfaceContrast
Define the contrast mode to use for the user interface.
-
#prefers_contrast=(prefers_contrast) ⇒ Gtk::InterfaceContrast
Define the contrast mode to use for the user interface.
-
#prefers_reduced_motion ⇒ Gtk::ReducedMotion
Define the type of reduced motion to use for the user interface.
-
#prefers_reduced_motion=(prefers_reduced_motion) ⇒ Gtk::ReducedMotion
Define the type of reduced motion to use for the user interface.
-
#to_string ⇒ String
Converts the provider into a string representation in CSS format.
Constructor Details
#initialize ⇒ Gtk::CssProvider
Returns a newly created GtkCssProvider.
Instance Method Details
#load_from_bytes(data) ⇒ nil
Loads data into css_provider.
This clears any previously loaded information.
#load_from_data(data, length) ⇒ nil
Loads data into css_provider.
This clears any previously loaded information.
#load_from_file(file) ⇒ nil
Loads the data contained in file into css_provider.
This clears any previously loaded information.
#load_from_path(path) ⇒ nil
Loads the data contained in path into css_provider.
This clears any previously loaded information.
#load_from_resource(resource_path) ⇒ nil
Loads the data contained in the resource at resource_path into
the css_provider.
This clears any previously loaded information.
#load_from_string(string) ⇒ nil
Loads string into css_provider.
This clears any previously loaded information.
#load_named(name, variant) ⇒ nil
Loads a theme from the usual theme paths.
The actual process of finding the theme might change between
releases, but it is guaranteed that this function uses the same
mechanism to load the theme that GTK uses for loading its own theme.
#prefers_color_scheme ⇒ Gtk::InterfaceColorScheme
Define the color scheme used for rendering the user interface.
The UI can be set to either [enumGtk.InterfaceColorScheme.LIGHT],
or [enumGtk.InterfaceColorScheme.DARK] mode. Other values will
be interpreted the same as [enumGtk.InterfaceColorScheme.LIGHT].
This setting is be available for media queries in CSS:
<b>media</b> (prefers-color-scheme: dark) {
// some dark mode styling
}
Changing this setting will reload the style sheet.
#prefers_color_scheme=(prefers_color_scheme) ⇒ Gtk::InterfaceColorScheme
Define the color scheme used for rendering the user interface.
The UI can be set to either [enumGtk.InterfaceColorScheme.LIGHT],
or [enumGtk.InterfaceColorScheme.DARK] mode. Other values will
be interpreted the same as [enumGtk.InterfaceColorScheme.LIGHT].
This setting is be available for media queries in CSS:
<b>media</b> (prefers-color-scheme: dark) {
// some dark mode styling
}
Changing this setting will reload the style sheet.
#prefers_contrast ⇒ Gtk::InterfaceContrast
Define the contrast mode to use for the user interface.
When set to [enumGtk.InterfaceContrast.MORE] or
[enumGtk.InterfaceContrast.LESS], the UI is rendered in
high or low contrast.
When set to [enumGtk.InterfaceContrast.NO_PREFERENCE] (the default),
the user interface will be rendered in default mode.
This setting is be available for media queries in CSS:
<b>media</b> (prefers-contrast: more) {
// some style with high contrast
}
Changing this setting will reload the style sheet.
#prefers_contrast=(prefers_contrast) ⇒ Gtk::InterfaceContrast
Define the contrast mode to use for the user interface.
When set to [enumGtk.InterfaceContrast.MORE] or
[enumGtk.InterfaceContrast.LESS], the UI is rendered in
high or low contrast.
When set to [enumGtk.InterfaceContrast.NO_PREFERENCE] (the default),
the user interface will be rendered in default mode.
This setting is be available for media queries in CSS:
<b>media</b> (prefers-contrast: more) {
// some style with high contrast
}
Changing this setting will reload the style sheet.
#prefers_reduced_motion ⇒ Gtk::ReducedMotion
Define the type of reduced motion to use for the user interface.
When set to [enumGtk.ReducedMotion.REDUCE] the UI is rendered in
with reduced motion animations.
When set to [enumGtk.ReducedMotion.NO_PREFERENCE] (the default),
the user interface will be rendered in default mode.
This setting is be available for media queries in CSS:
<b>media</b> (prefers-reduced-motion: reduce) {
// some style with reduced motion
}
Changing this setting will reload the style sheet.
#prefers_reduced_motion=(prefers_reduced_motion) ⇒ Gtk::ReducedMotion
Define the type of reduced motion to use for the user interface.
When set to [enumGtk.ReducedMotion.REDUCE] the UI is rendered in
with reduced motion animations.
When set to [enumGtk.ReducedMotion.NO_PREFERENCE] (the default),
the user interface will be rendered in default mode.
This setting is be available for media queries in CSS:
<b>media</b> (prefers-reduced-motion: reduce) {
// some style with reduced motion
}
Changing this setting will reload the style sheet.
#to_string ⇒ String
Converts the provider into a string representation in CSS
format.
Using [methodGtk.CssProvider.load_from_string] with the return
value from this function on a new provider created with
[ctorGtk.CssProvider.new] will basically create a duplicate
of this provider.