Skip to main content

ContainerTheme

Struct ContainerTheme 

Source
pub struct ContainerTheme(/* private fields */);
Expand description

Theme overrides of how a container decorates its children.

This object is returned by Window::container_theme. It has no effect if the window is not a container.

Settings that are not set fall back to the global theme. Not every setting has an effect on every container.

Implementations§

Source§

impl ContainerTheme

Source

pub fn set_color(&self, element: Colorable, color: Color)

Sets the color of a GUI element.

The following elements apply to the container as a whole. This theme takes priority over the global theme.

The following elements apply to the decorations of each child. The WindowTheme of the child takes priority over this theme, which takes priority over the global theme.

Source

pub fn set_size(&self, element: Resizable, size: i32)

Sets the size of a GUI element.

The following elements are supported:

They apply to the container as a whole. This theme takes priority over the global theme.

Source

pub fn set_show_titles(&self, show: bool)

Sets whether titles are shown.

This applies to the container as a whole. This theme takes priority over the global theme.

See also set_show_titles.

Source

pub fn set_show_window_icons(&self, show: bool)

Sets whether window icons set by the client are shown.

This applies to the decorations of each child. The WindowTheme of the child takes priority over this theme, which takes priority over the global theme.

See also set_show_window_icons.

Source

pub fn set_window_icons_grayscale(&self, grayscale: bool)

Sets whether window icons set by the client are rendered as grayscale.

This applies to the decorations of each child. The WindowTheme of the child takes priority over this theme, which takes priority over the global theme.

See also set_window_icons_grayscale.

Source

pub fn set_title_font(&self, font: &str)

Sets the font used by window titles.

This applies to the decorations of each child. The WindowTheme of the child takes priority over this theme, which takes priority over the global theme.

See also set_title_font.

Source

pub fn set_container_borders(&self, borders: ContainerBorders)

Sets the container border style.

This theme takes priority over the global theme.

See also set_container_borders.

Source

pub fn unset_container_borders(&self)

Removes the override of the container border style.

See also set_container_borders.

Source

pub fn get_container_borders(&self) -> Option<ContainerBorders>

Gets the override of the container border style.

Methods from Deref<Target = ThemeOverrides>§

Source

pub fn window(&self) -> Window

Returns the window that the overrides belong to.

Source

pub fn reset(&self)

Removes all overrides.

Source

pub fn set_color(&self, element: Colorable, color: Color)

Sets the color of a GUI element.

Source

pub fn unset_color(&self, element: Colorable)

Removes the color override of a GUI element.

See also set_color.

Source

pub fn get_color(&self, element: Colorable) -> Option<Color>

Gets the color override of a GUI element.

Source

pub fn set_size(&self, element: Resizable, size: i32)

Sets the size of a GUI element.

Source

pub fn unset_size(&self, element: Resizable)

Removes the size override of a GUI element.

See also set_size.

Source

pub fn get_size(&self, element: Resizable) -> Option<i32>

Gets the size override of a GUI element.

Source

pub fn set_show_titles(&self, show: bool)

Sets whether titles are shown.

See also set_show_titles.

Source

pub fn unset_show_titles(&self)

Removes the override of whether titles are shown.

See also set_show_titles.

Source

pub fn get_show_titles(&self) -> Option<bool>

Gets the override of whether titles are shown.

Source

pub fn set_show_window_icons(&self, show: bool)

Sets whether window icons set by the client are shown.

See also set_show_window_icons.

Source

pub fn unset_show_window_icons(&self)

Removes the override of whether window icons set by the client are shown.

See also set_show_window_icons.

Source

pub fn set_window_icons_grayscale(&self, grayscale: bool)

Sets whether window icons set by the client are rendered as grayscale.

See also set_window_icons_grayscale.

Source

pub fn unset_window_icons_grayscale(&self)

Removes the override of whether window icons set by the client are rendered as grayscale.

See also set_window_icons_grayscale.

Source

pub fn set_title_font(&self, font: &str)

Sets the font used by window titles.

See also set_title_font.

Source

pub fn unset_title_font(&self)

Removes the override of the font used by window titles.

See also set_title_font.

Trait Implementations§

Source§

impl Clone for ContainerTheme

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ContainerTheme

Source§

impl Debug for ContainerTheme

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for ContainerTheme

Source§

type Target = ThemeOverrides

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Eq for ContainerTheme

Source§

impl Hash for ContainerTheme

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ContainerTheme

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ContainerTheme

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.