use ui::widgets::{Layout, Takeover};
let open = self.details.get(self.running); // self.details: Takeover
div()
.child(div().id("details")
.on_click(cx.listener(|view, _, _, cx| {
view.details.toggle(view.running);
cx.notify();
}))
.child(theme.collapsible_header("Details", open)))
.when(open, |el| el.child(body))- The header is a row, not a container: render the body yourself. A plain
boolworks where nothing drives it. Takeoverfollows itsautovalue until the firsttoggle, then holds the user's choice. Pass the sameautotogetandtoggle.- Hover is the caller's;
Theme::element_hoveris the wash.