File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,16 @@ JsonTree::new("simple-tree", &value).show(ui);
28
28
29
29
// Customised:
30
30
let response = JsonTree :: new (" customised-tree" , & value )
31
- . style (JsonTreeStyle {
32
- visuals : Some (JsonTreeVisuals {
33
- bool_color : Color32 :: YELLOW ,
34
- .. Default :: default ()
35
- }),
36
- .. Default :: default ()
37
- })
31
+ . style (
32
+ JsonTreeStyle :: new ()
33
+ . abbreviate_root (true ) // Show {...} when the root object is collapsed.
34
+ . toggle_buttons_state (ToggleButtonsState :: VisibleDisabled )
35
+ . visuals (JsonTreeVisuals {
36
+ bool_color : Color32 :: YELLOW ,
37
+ .. Default :: default ()
38
+ }),
39
+ )
38
40
. default_expand (DefaultExpand :: All )
39
- . abbreviate_root (true ) // Show {...} when the root object is collapsed.
40
- . toggle_buttons_state (ToggleButtonsState :: VisibleDisabled )
41
41
. on_render (| ui , ctx | {
42
42
// Customise rendering of the JsonTree, and/or handle interactions.
43
43
match ctx {
Original file line number Diff line number Diff line change 23
23
//!
24
24
//! // Customised:
25
25
//! let response = JsonTree::new("customised-tree", &value)
26
- //! .style(JsonTreeStyle {
27
- //! visuals: Some(JsonTreeVisuals {
28
- //! bool_color: Color32::YELLOW,
29
- //! ..Default::default()
30
- //! }),
31
- //! ..Default::default()
32
- //! })
26
+ //! .style(
27
+ //! JsonTreeStyle::new()
28
+ //! .abbreviate_root(true) // Show {...} when the root object is collapsed.
29
+ //! .toggle_buttons_state(ToggleButtonsState::VisibleDisabled)
30
+ //! .visuals(JsonTreeVisuals {
31
+ //! bool_color: Color32::YELLOW,
32
+ //! ..Default::default()
33
+ //! }),
34
+ //! )
33
35
//! .default_expand(DefaultExpand::All)
34
- //! .abbreviate_root(true) // Show {...} when the root object is collapsed.
35
- //! .toggle_buttons_state(ToggleButtonsState::VisibleDisabled)
36
36
//! .on_render(|ui, ctx| {
37
37
//! // Customise rendering of the JsonTree, and/or handle interactions.
38
38
//! match ctx {
You can’t perform that action at this time.
0 commit comments