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);
2828
2929// Customised:
3030let 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+ )
3840 . default_expand (DefaultExpand :: All )
39- . abbreviate_root (true ) // Show {...} when the root object is collapsed.
40- . toggle_buttons_state (ToggleButtonsState :: VisibleDisabled )
4141 . on_render (| ui , ctx | {
4242 // Customise rendering of the JsonTree, and/or handle interactions.
4343 match ctx {
Original file line number Diff line number Diff line change 2323//!
2424//! // Customised:
2525//! 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+ //! )
3335//! .default_expand(DefaultExpand::All)
34- //! .abbreviate_root(true) // Show {...} when the root object is collapsed.
35- //! .toggle_buttons_state(ToggleButtonsState::VisibleDisabled)
3636//! .on_render(|ui, ctx| {
3737//! // Customise rendering of the JsonTree, and/or handle interactions.
3838//! match ctx {
You can’t perform that action at this time.
0 commit comments