loaded_filename
This commit is contained in:
parent
0a4e84d3d2
commit
24d2c0b2dc
|
@ -140,7 +140,7 @@ impl HeaderPanel {
|
|||
platform::pick_and_load_waveform(Some(file)).await
|
||||
{
|
||||
loaded_filename.set_neq(Some(filename));
|
||||
hierarchy.set(Some(Rc::new(platform::get_hierarchy().await)))
|
||||
hierarchy.set(Some(Arc::new(platform::get_hierarchy().await)))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -26,6 +26,7 @@ type Filename = String;
|
|||
struct Store {
|
||||
selected_var_refs: MutableVec<wellen::VarRef>,
|
||||
hierarchy: Mutable<Option<Arc<wellen::Hierarchy>>>,
|
||||
loaded_filename: Mutable<Option<Filename>>,
|
||||
}
|
||||
|
||||
static STORE: Lazy<Store> = lazy::default();
|
||||
|
@ -43,7 +44,7 @@ fn root() -> impl Element {
|
|||
let hierarchy = STORE.hierarchy.clone();
|
||||
let selected_var_refs = STORE.selected_var_refs.clone();
|
||||
let layout: Mutable<Layout> = <_>::default();
|
||||
let loaded_filename: Mutable<Option<Filename>> = <_>::default();
|
||||
let loaded_filename = STORE.loaded_filename.clone();
|
||||
Column::new()
|
||||
.s(Height::fill())
|
||||
.s(Scrollbars::y_and_clip_x())
|
||||
|
|
|
@ -49,8 +49,9 @@ impl FW {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn loaded_filename() -> String {
|
||||
format!("todo loaded filename")
|
||||
/// JS: `FW.loaded_filename()` -> `simple.vcd`
|
||||
pub fn loaded_filename() -> Option<String> {
|
||||
STORE.loaded_filename.get_cloned()
|
||||
}
|
||||
|
||||
/// JS: `FW.selected_vars()` -> `["simple_tb.s.A", "simple_tb.s.B"]`
|
||||
|
|
Loading…
Reference in a new issue