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
§separator: SeparatorStyle
§tab_bar: TabBarStyle
§tab: TabStyle
§overlay: OverlayStyle
Implementations§
source§impl Style
impl Style
sourcepub fn from_egui(style: &Style) -> Self
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§
Auto Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more