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
impl WindowTheme
Sourcepub fn set_color(&self, element: Colorable, color: Color)
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.
BORDER_COLORFOCUSED_BORDER_COLORSEPARATOR_COLORUNFOCUSED_TITLE_BACKGROUND_COLORFOCUSED_TITLE_BACKGROUND_COLORATTENTION_REQUESTED_BACKGROUND_COLORUNFOCUSED_TITLE_TEXT_COLORFOCUSED_TITLE_TEXT_COLOR
Tiled windows use the following elements. This theme takes priority over the
ContainerTheme of the parent container, which takes priority over the global
theme.
FOCUSED_BORDER_COLORBORDER_COLOR: only used as the default ofFOCUSED_BORDER_COLOR. The other borders use the border color of the container.UNFOCUSED_TITLE_BACKGROUND_COLORFOCUSED_TITLE_BACKGROUND_COLORFOCUSED_INACTIVE_TITLE_BACKGROUND_COLORATTENTION_REQUESTED_BACKGROUND_COLORUNFOCUSED_TITLE_TEXT_COLORFOCUSED_TITLE_TEXT_COLORFOCUSED_INACTIVE_TITLE_TEXT_COLOR
For tiled windows, the separator color is a property of the container and is set
with ContainerTheme::set_color.
Sourcepub fn set_size(&self, element: Resizable, size: i32)
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.
Sourcepub fn set_show_titles(&self, show: bool)
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.
Sourcepub fn set_show_window_icons(&self, show: bool)
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.
Sourcepub fn set_window_icons_grayscale(&self, grayscale: bool)
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.
Sourcepub fn set_title_font(&self, font: &str)
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>§
Sourcepub fn unset_color(&self, element: Colorable)
pub fn unset_color(&self, element: Colorable)
Removes the color override of a GUI element.
See also set_color.
Sourcepub fn get_color(&self, element: Colorable) -> Option<Color>
pub fn get_color(&self, element: Colorable) -> Option<Color>
Gets the color override of a GUI element.
Sourcepub fn unset_size(&self, element: Resizable)
pub fn unset_size(&self, element: Resizable)
Removes the size override of a GUI element.
See also set_size.
Sourcepub fn get_size(&self, element: Resizable) -> Option<i32>
pub fn get_size(&self, element: Resizable) -> Option<i32>
Gets the size override of a GUI element.
Sourcepub fn set_show_titles(&self, show: bool)
pub fn set_show_titles(&self, show: bool)
Sets whether titles are shown.
See also set_show_titles.
Sourcepub fn unset_show_titles(&self)
pub fn unset_show_titles(&self)
Removes the override of whether titles are shown.
See also set_show_titles.
Sourcepub fn get_show_titles(&self) -> Option<bool>
pub fn get_show_titles(&self) -> Option<bool>
Gets the override of whether titles are shown.
Sourcepub fn set_show_window_icons(&self, show: bool)
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.
Sourcepub fn unset_show_window_icons(&self)
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.
Sourcepub fn set_window_icons_grayscale(&self, grayscale: bool)
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.
Sourcepub fn unset_window_icons_grayscale(&self)
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.
Sourcepub fn set_title_font(&self, font: &str)
pub fn set_title_font(&self, font: &str)
Sets the font used by window titles.
See also set_title_font.
Sourcepub fn unset_title_font(&self)
pub fn unset_title_font(&self)
Removes the override of the font used by window titles.
See also set_title_font.