pub struct Visuals {Show 17 fields
pub dark_mode: bool,
pub override_text_color: Option<Color32>,
pub widgets: Widgets,
pub selection: Selection,
pub hyperlink_color: Color32,
pub faint_bg_color: Color32,
pub extreme_bg_color: Color32,
pub code_bg_color: Color32,
pub window_rounding: Rounding,
pub window_shadow: Shadow,
pub popup_shadow: Shadow,
pub resize_corner_size: f32,
pub text_cursor_width: f32,
pub text_cursor_preview: bool,
pub clip_rect_margin: f32,
pub button_frame: bool,
pub collapsing_header_frame: bool,
}
Expand description
Controls the visual style (colors etc) of egui.
You can change the visuals of a Ui
with Ui::visuals_mut
and of everything with crate::Context::set_visuals
.
If you want to change fonts, use crate::Context::set_fonts
instead.
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 whether or not the widget is being interacted with.
In the future we may instead modulate
the text_color
based on whether 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: Selection
hyperlink_color: Color32
The color used for Hyperlink
,
faint_bg_color: Color32
Something just barely different from the background color.
Used for crate::Grid::striped
.
extreme_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.
code_bg_color: Color32
Background color behind code-styled monospaced labels.
window_rounding: Rounding
window_shadow: Shadow
popup_shadow: Shadow
resize_corner_size: f32
text_cursor_width: f32
text_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
Show a background behind buttons.
collapsing_header_frame: bool
Show a background behind collapsing headers.
Implementations
sourceimpl Visuals
impl Visuals
pub fn noninteractive(&self) -> &WidgetVisuals
pub fn text_color(&self) -> Color32
pub fn weak_text_color(&self) -> Color32
pub fn strong_text_color(&self) -> Color32
sourcepub fn window_fill(&self) -> Color32
pub fn window_fill(&self) -> Color32
Window background color.
pub fn window_stroke(&self) -> Stroke
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Visuals where
Visuals: Default,
impl<'de> Deserialize<'de> for Visuals where
Visuals: Default,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Visuals
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more