use crate::tokens::DESIGN_TOKENS;
#[derive(Clone, Debug)]
pub struct ObjectTreeConfig {
pub show_data_window: bool,
pub show_hidden_objects: bool,
pub show_lock_indicator: bool,
pub show_color_indicators: bool,
pub group_by_type: bool,
pub show_item_counts: bool,
pub show_expand_chevron: bool,
pub enable_drag_drop: bool,
pub enable_multi_select: bool,
pub enable_inline_edit: bool,
pub enable_context_menu: bool,
pub enable_keyboard_shortcuts: bool,
pub row_height: f32,
pub indent_width: f32,
pub max_height: f32,
pub icon_size: f32,
pub color_indicator_size: f32,
pub toggle_size: f32,
pub animate_transitions: bool,
}
impl Default for ObjectTreeConfig {
fn default() -> Self {
Self {
show_data_window: true,
show_hidden_objects: true,
show_lock_indicator: true,
show_color_indicators: true,
group_by_type: true,
show_item_counts: true,
show_expand_chevron: true,
enable_drag_drop: true,
enable_multi_select: true,
enable_inline_edit: false, enable_context_menu: true,
enable_keyboard_shortcuts: true,
row_height: DESIGN_TOKENS.sizing.button_sm, indent_width: DESIGN_TOKENS.spacing.xl, max_height: 400.0,
icon_size: 16.0,
color_indicator_size: 10.0,
toggle_size: 16.0,
animate_transitions: true,
}
}
}
impl ObjectTreeConfig {
pub fn minimal() -> Self {
Self {
show_data_window: false,
show_hidden_objects: false,
show_lock_indicator: false,
show_color_indicators: false,
group_by_type: false,
show_item_counts: false,
show_expand_chevron: false,
enable_drag_drop: false,
enable_multi_select: false,
enable_inline_edit: false,
enable_context_menu: false,
enable_keyboard_shortcuts: false,
animate_transitions: false,
..Default::default()
}
}
pub fn compact() -> Self {
Self {
row_height: 20.0,
indent_width: 8.0,
icon_size: 14.0,
color_indicator_size: 8.0,
toggle_size: 14.0,
..Default::default()
}
}
}