[]Struct gtk::CssProvider

pub struct CssProvider(_, _);

CssProvider is an object implementing the StyleProvider 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 CssProviderExt::load_from_file or CssProviderExt::load_from_resource and adding the provider with StyleContextExt::add_provider or StyleContext::add_provider_for_screen.

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 Settings: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 Settings:gtk-key-theme-name.

Implements

CssProviderExt, glib::object::ObjectExt, StyleProviderExt

Implementations

impl CssProvider[src]

pub fn new() -> CssProvider[src]

Returns a newly created CssProvider.

Returns

A new CssProvider

pub fn get_default() -> Option<CssProvider>[src]

Returns the provider containing the style settings used as a fallback for all widgets.

Deprecated since 3.24

Use CssProvider::new instead.

Returns

The provider used for fallback styling. This memory is owned by GTK+, and you must not free it.

pub fn get_named(name: &str, variant: Option<&str>) -> Option<CssProvider>[src]

Loads a theme from the usual theme paths

name

A theme name

variant

variant to load, for example, "dark", or None for the default

Returns

a CssProvider with the theme loaded. This memory is owned by GTK+, and you must not free it.

Trait Implementations

impl Clone for CssProvider

impl Debug for CssProvider

impl Default for CssProvider[src]

impl Display for CssProvider[src]

impl Eq for CssProvider

impl Hash for CssProvider

impl IsA<StyleProvider> for CssProvider

impl Ord for CssProvider

impl<T: ObjectType> PartialEq<T> for CssProvider

impl<T: ObjectType> PartialOrd<T> for CssProvider

impl StaticType for CssProvider

Auto Trait Implementations

impl RefUnwindSafe for CssProvider

impl !Send for CssProvider

impl !Sync for CssProvider

impl Unpin for CssProvider

impl UnwindSafe for CssProvider

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.