Struct egui_dock::style::Style

source ·
pub struct Style {
    pub dock_area_padding: Option<Margin>,
    pub main_surface_border_stroke: Stroke,
    pub main_surface_border_rounding: Rounding,
    pub buttons: ButtonsStyle,
    pub separator: SeparatorStyle,
    pub tab_bar: TabBarStyle,
    pub tab: TabStyle,
    pub overlay: OverlayStyle,
}
Expand description

Lets you change how tabs and the DockArea should look and feel. Style is divided into several, more specialized structs that handle individual elements of the UI.

Your Style can inherit all its properties from an egui::Style through the Style::from_egui function.

Example:

// Inherit the look and feel from egui.
let mut style = Style::from_egui(ui.style());

// Modify a few fields.
style.overlay.overlay_type = OverlayType::HighlightedAreas;
style.buttons.add_tab_align = TabAddAlign::Left;

// Use the style with the `DockArea`.
DockArea::new(&mut dock_state)
    .style(style)
    .show_inside(ui, &mut MyTabViewer);

Fields§

§dock_area_padding: Option<Margin>

Sets padding to indent from the edges of the window. By Default it’s None.

§main_surface_border_stroke: Stroke§main_surface_border_rounding: Rounding§buttons: ButtonsStyle§separator: SeparatorStyle§tab_bar: TabBarStyle§tab: TabStyle§overlay: OverlayStyle

Implementations§

source§

impl Style

source

pub fn from_egui(style: &Style) -> Self

Derives relevant fields from egui::Style and sets the remaining fields to their default values.

Fields overwritten by egui::Style are:

See also: ButtonsStyle::from_egui, SeparatorStyle::from_egui, TabBarStyle::from_egui, TabStyle::from_egui

Trait Implementations§

source§

impl Clone for Style

source§

fn clone(&self) -> Style

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Style

source§

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

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

impl Default for Style

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Style

§

impl RefUnwindSafe for Style

§

impl Send for Style

§

impl Sync for Style

§

impl Unpin for Style

§

impl UnwindSafe for Style

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> 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<T> ToOwned for T
where T: Clone,

§

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>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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.
source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,