Struct egui::style::Visuals[][src]

pub struct Visuals {
Show fields pub dark_mode: bool, pub override_text_color: Option<Color32>, pub widgets: Widgets, pub selection: Selection, pub extreme_bg_color: Color32, pub hyperlink_color: Color32, pub code_bg_color: Color32, pub window_corner_radius: f32, pub window_shadow: Shadow, pub resize_corner_size: f32, pub text_cursor_width: f32, pub text_cursor_preview: bool, pub clip_rect_margin: f32,
}

Fields

dark_mode: bool

If true, the visuals are overall dark with light text. If false, the visuals are overall light with dark text.

NOTE: setting this does very little by itself, this is more to provide a convenient summary of the rest of the settings.

override_text_color: Option<Color32>

Override default text color for all text.

This is great for setting the color of text for any widget.

If text_color is None (default), then the text color will be the same as the foreground stroke color (WidgetVisuals::fg_stroke) and will depend on wether or not the widget is being interacted with.

In the future we may instead modulate the text_color based on wether or not it is interacted with so that visuals.text_color is always used, but its alpha may be different based on whether or not it is disabled, non-interactive, hovered etc.

widgets: Widgets

Visual styles of widgets

selection: Selectionextreme_bg_color: Color32

Very dark or light color (for corresponding theme). Used as the background of text edits, scroll bars and others things that needs to look different from other interactive stuff.

hyperlink_color: Color32

The color used for Hyperlink,

code_bg_color: Color32

Background color behind code-styled monospaced labels.

window_corner_radius: f32window_shadow: Shadowresize_corner_size: f32text_cursor_width: f32text_cursor_preview: bool

show where the text cursor would be if you clicked

clip_rect_margin: f32

Allow child widgets to be just on the border and still have a stroke with some thickness

Implementations

impl Visuals[src]

pub fn noninteractive(&self) -> &WidgetVisuals[src]

pub fn text_color(&self) -> Color32[src]

pub fn weak_text_color(&self) -> Color32[src]

pub fn strong_text_color(&self) -> Color32[src]

pub fn window_fill(&self) -> Color32[src]

pub fn window_stroke(&self) -> Stroke[src]

impl Visuals[src]

pub fn dark() -> Self[src]

Default dark theme.

pub fn light() -> Self[src]

Default light theme.

impl Visuals[src]

pub fn light_dark_radio_buttons(&mut self, ui: &mut Ui)[src]

Show radio-buttons to switch between light and dark mode.

#[must_use]
pub fn light_dark_small_toggle_button(&self, ui: &mut Ui) -> Option<Self>
[src]

Show small toggle-button for light and dark mode.

pub fn ui(&mut self, ui: &mut Ui)[src]

Trait Implementations

impl Clone for Visuals[src]

fn clone(&self) -> Visuals[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Visuals[src]

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

Formats the value using the given formatter. Read more

impl Default for Visuals[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl PartialEq<Visuals> for Visuals[src]

fn eq(&self, other: &Visuals) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Visuals) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for Visuals[src]

Auto Trait Implementations

impl RefUnwindSafe for Visuals

impl Send for Visuals

impl Sync for Visuals

impl Unpin for Visuals

impl UnwindSafe for Visuals

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

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

Performs the conversion.