pub struct CssProviderBuilder { /* private fields */ }Expand description
A builder-pattern type to construct CssProvider objects.
Implementations§
Source§impl CssProviderBuilder
impl CssProviderBuilder
Sourcepub fn prefers_color_scheme(
self,
prefers_color_scheme: InterfaceColorScheme,
) -> Self
Available on crate feature v4_20 only.
pub fn prefers_color_scheme( self, prefers_color_scheme: InterfaceColorScheme, ) -> Self
v4_20 only.Define the color scheme used for rendering the user interface.
The UI can be set to either [enum@Gtk.InterfaceColorScheme.LIGHT], or [enum@Gtk.InterfaceColorScheme.DARK] mode. Other values will be interpreted the same as [enum@Gtk.InterfaceColorScheme.LIGHT].
This setting is be available for media queries in CSS:
@media (prefers-color-scheme: dark) {
// some dark mode styling
}Changing this setting will reload the style sheet.
Sourcepub fn prefers_contrast(self, prefers_contrast: InterfaceContrast) -> Self
Available on crate feature v4_20 only.
pub fn prefers_contrast(self, prefers_contrast: InterfaceContrast) -> Self
v4_20 only.Define the contrast mode to use for the user interface.
When set to [enum@Gtk.InterfaceContrast.MORE] or [enum@Gtk.InterfaceContrast.LESS], the UI is rendered in high or low contrast.
When set to [enum@Gtk.InterfaceContrast.NO_PREFERENCE] (the default), the user interface will be rendered in default mode.
This setting is be available for media queries in CSS:
@media (prefers-contrast: more) {
// some style with high contrast
}Changing this setting will reload the style sheet.
Sourcepub fn prefers_reduced_motion(
self,
prefers_reduced_motion: ReducedMotion,
) -> Self
Available on crate feature v4_22 only.
pub fn prefers_reduced_motion( self, prefers_reduced_motion: ReducedMotion, ) -> Self
v4_22 only.Define the type of reduced motion to use for the user interface.
When set to [enum@Gtk.ReducedMotion.REDUCE] the UI is rendered in with reduced motion animations.
When set to [enum@Gtk.ReducedMotion.NO_PREFERENCE] (the default), the user interface will be rendered in default mode.
This setting is be available for media queries in CSS:
@media (prefers-reduced-motion: reduce) {
// some style with reduced motion
}Changing this setting will reload the style sheet.
Sourcepub fn build(self) -> CssProvider
pub fn build(self) -> CssProvider
Build the CssProvider.