Skip to main content

WindowTheme

Struct WindowTheme 

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

Theme overrides of a window.

This object is returned by Window::theme. It contains the theme of the window itself. How a container decorates its children is configured with ContainerTheme.

Settings that are not set fall back to the theme of the parent container, if any, and then to the global theme. Not every setting has an effect on every window.

Implementations§

Source§

impl WindowTheme

Source

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

Sets the color of a GUI element.

Floating windows use the following elements. This theme takes priority over the global theme.

Tiled windows use the following elements. This theme takes priority over the ContainerTheme of the parent container, which takes priority over the global theme.

For tiled windows, the separator color is a property of the container and is set with ContainerTheme::set_color.

Source

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

Sets the size of a GUI element.

The following elements are supported:

They are only used for floating windows. This theme takes priority over the global theme. For tiled windows, these sizes are properties of the container and are set with ContainerTheme::set_size.

Source

pub fn set_show_titles(&self, show: bool)

Sets whether titles are shown.

This is only used for floating windows. This theme takes priority over the global theme. For tiled windows, this is a property of the container and is set with ContainerTheme::set_show_titles.

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.

For floating windows, this theme takes priority over the global theme. For tiled windows, this theme takes priority over the ContainerTheme of the parent container, 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.

For floating windows, this theme takes priority over the global theme. For tiled windows, this theme takes priority over the ContainerTheme of the parent container, 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.

For floating windows, this theme takes priority over the global theme. For tiled windows, this theme takes priority over the ContainerTheme of the parent container, which takes priority over the global theme.

See also set_title_font.

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 WindowTheme

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 WindowTheme

Source§

impl Debug for WindowTheme

Source§

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

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

impl Deref for WindowTheme

Source§

type Target = ThemeOverrides

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Eq for WindowTheme

Source§

impl Hash for WindowTheme

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 WindowTheme

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 WindowTheme

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.