Skip to content

Commit b1ac2aa

Browse files
committed
update docs/readme
1 parent d9c98e9 commit b1ac2aa

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ JsonTree::new("simple-tree", &value).show(ui);
2828

2929
// Customised:
3030
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+
)
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 {

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
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 {

0 commit comments

Comments
 (0)