egui_charts/ui/widget_bar/panels/object_tree/
config.rs1use crate::tokens::DESIGN_TOKENS;
6
7#[derive(Clone, Debug)]
9pub struct ObjectTreeConfig {
10 pub show_data_window: bool,
13 pub show_hidden_objects: bool,
15 pub show_lock_indicator: bool,
17 pub show_color_indicators: bool,
19 pub group_by_type: bool,
21 pub show_item_counts: bool,
23 pub show_expand_chevron: bool,
25
26 pub enable_drag_drop: bool,
29 pub enable_multi_select: bool,
31 pub enable_inline_edit: bool,
33 pub enable_context_menu: bool,
35 pub enable_keyboard_shortcuts: bool,
37
38 pub row_height: f32,
41 pub indent_width: f32,
43 pub max_height: f32,
45 pub icon_size: f32,
47 pub color_indicator_size: f32,
49 pub toggle_size: f32,
51
52 pub animate_transitions: bool,
55}
56
57impl Default for ObjectTreeConfig {
58 fn default() -> Self {
59 Self {
60 show_data_window: true,
62 show_hidden_objects: true,
63 show_lock_indicator: true,
64 show_color_indicators: true,
65 group_by_type: true,
66 show_item_counts: true,
67 show_expand_chevron: true,
68
69 enable_drag_drop: true,
71 enable_multi_select: true,
72 enable_inline_edit: false, enable_context_menu: true,
74 enable_keyboard_shortcuts: true,
75
76 row_height: DESIGN_TOKENS.sizing.button_sm, indent_width: crate::theme::Theme::default().spacing.xl, max_height: 400.0,
80 icon_size: 16.0,
81 color_indicator_size: 10.0,
82 toggle_size: 16.0,
83
84 animate_transitions: true,
86 }
87 }
88}
89
90impl ObjectTreeConfig {
91 pub fn minimal() -> Self {
93 Self {
94 show_data_window: false,
95 show_hidden_objects: false,
96 show_lock_indicator: false,
97 show_color_indicators: false,
98 group_by_type: false,
99 show_item_counts: false,
100 show_expand_chevron: false,
101 enable_drag_drop: false,
102 enable_multi_select: false,
103 enable_inline_edit: false,
104 enable_context_menu: false,
105 enable_keyboard_shortcuts: false,
106 animate_transitions: false,
107 ..Default::default()
108 }
109 }
110
111 pub fn compact() -> Self {
113 Self {
114 row_height: 20.0,
115 indent_width: 8.0,
116 icon_size: 14.0,
117 color_indicator_size: 8.0,
118 toggle_size: 14.0,
119 ..Default::default()
120 }
121 }
122}