Style

Struct Style 

Source
pub struct Style {
    pub indent: f32,
    pub icon_spacing: f32,
    pub row_height: f32,
    pub expand_icon_size: f32,
    pub action_icon_size: f32,
    pub selection_color: Option<Color32>,
    pub hover_color: Option<Color32>,
    pub expand_icon_style: ExpandIconStyle,
}
Expand description

Style configuration for the outliner widget.

Controls the visual appearance including spacing, colors, and icon sizes. Use the builder pattern methods for convenient construction:

use egui_arbor::Style;
use egui::Color32;

let style = Style::default()
    .with_indent(20.0)
    .with_selection_color(Color32::from_rgb(100, 150, 200));

Fields§

§indent: f32

Indentation per hierarchy level in logical pixels.

Default: 16.0

§icon_spacing: f32

Spacing between icon and text in logical pixels.

Default: 4.0

§row_height: f32

Height of each row in logical pixels.

Default: 20.0

§expand_icon_size: f32

Size of expand/collapse arrow in logical pixels.

Default: 12.0

§action_icon_size: f32

Size of action icons in logical pixels.

Default: 16.0

§selection_color: Option<Color32>

Optional selection highlight color.

If None, uses egui’s default selection color.

§hover_color: Option<Color32>

Optional hover highlight color.

If None, uses egui’s default hover color.

§expand_icon_style: ExpandIconStyle

Style of the expand/collapse icon.

Default: ExpandIconStyle::Arrow

Implementations§

Source§

impl Style

Source

pub fn with_indent(self, indent: f32) -> Self

Set the indentation per hierarchy level.

§Arguments
  • indent - Indentation in logical pixels
§Example
use egui_arbor::Style;

let style = Style::default().with_indent(20.0);
Source

pub fn with_icon_spacing(self, spacing: f32) -> Self

Set the spacing between icon and text.

§Arguments
  • spacing - Spacing in logical pixels
§Example
use egui_arbor::Style;

let style = Style::default().with_icon_spacing(6.0);
Source

pub fn with_row_height(self, height: f32) -> Self

Set the height of each row.

§Arguments
  • height - Row height in logical pixels
§Example
use egui_arbor::Style;

let style = Style::default().with_row_height(24.0);
Source

pub fn with_expand_icon_size(self, size: f32) -> Self

Set the size of expand/collapse arrows.

§Arguments
  • size - Icon size in logical pixels
§Example
use egui_arbor::Style;

let style = Style::default().with_expand_icon_size(14.0);
Source

pub fn with_action_icon_size(self, size: f32) -> Self

Set the size of action icons.

§Arguments
  • size - Icon size in logical pixels
§Example
use egui_arbor::Style;

let style = Style::default().with_action_icon_size(18.0);
Source

pub fn with_selection_color(self, color: Color32) -> Self

Set the selection highlight color.

§Arguments
  • color - The color to use for selection highlighting
§Example
use egui_arbor::Style;
use egui::Color32;

let style = Style::default()
    .with_selection_color(Color32::from_rgb(100, 150, 200));
Source

pub fn with_hover_color(self, color: Color32) -> Self

Set the hover highlight color.

§Arguments
  • color - The color to use for hover highlighting
§Example
use egui_arbor::Style;
use egui::Color32;

let style = Style::default()
    .with_hover_color(Color32::from_rgb(150, 180, 210));
Source

pub fn with_expand_icon_style(self, style: ExpandIconStyle) -> Self

Set the expand/collapse icon style.

§Arguments
  • style - The icon style to use
§Example
use egui_arbor::{Style, ExpandIconStyle};

let style = Style::default()
    .with_expand_icon_style(ExpandIconStyle::PlusMinus);

Trait Implementations§

Source§

impl Clone for Style

Source§

fn clone(&self) -> Style

Returns a duplicate 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

Source§

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

Source§

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,