File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,6 +179,8 @@ pub enum UIAction {
179179 SolverActive ,
180180 Save ,
181181 Show ,
182+ ExpandAll ,
183+ CollapseAll ,
182184}
183185#[ derive( Debug , Clone ) ]
184186pub enum UISyncState {
@@ -490,6 +492,20 @@ async fn ui_event_loop(
490492 } ) ;
491493 }
492494 }
495+ UIAction :: ExpandAll => {
496+ ui_config. with_mut ( |UIConfigState { entries, .. } | {
497+ entries. into_iter ( ) . for_each ( |( _, entrie) | {
498+ entrie. open = true ;
499+ } )
500+ } ) ;
501+ }
502+ UIAction :: CollapseAll => {
503+ ui_config. with_mut ( |UIConfigState { entries, .. } | {
504+ entries. into_iter ( ) . for_each ( |( _, entrie) | {
505+ entrie. open = false ;
506+ } )
507+ } ) ;
508+ }
493509 UIAction :: Save => {
494510 let module = tx_config. borrow ( ) . module . clone ( ) ;
495511 let output_name = ui_state. read ( ) . file_name . clone ( ) ;
Original file line number Diff line number Diff line change @@ -554,6 +554,24 @@ pub fn App(cx: Scope<AppProps>) -> Element {
554554 }
555555 }
556556 }
557+ li{
558+ button{
559+ class: "btn-save" ,
560+ onclick: move |_|{
561+ ui_tx. send( UIAction :: ExpandAll ) ;
562+ } ,
563+ rsx!{ "Expand All" }
564+ }
565+ }
566+ li{
567+ button{
568+ class: "btn-save" ,
569+ onclick: move |_|{
570+ ui_tx. send( UIAction :: CollapseAll ) ;
571+ } ,
572+ rsx!{ "Collapse All" }
573+ }
574+ }
557575 }
558576 "Files:"
559577 table{
You can’t perform that action at this time.
0 commit comments