mirror of
https://github.com/elkowar/eww.git
synced 2024-10-03 22:48:31 +03:00
Merge 1f5e0cce9c
into e242d40e35
This commit is contained in:
commit
c878fc174e
@ -220,6 +220,9 @@ impl ScopeGraph {
|
||||
let listener = Rc::new(listener);
|
||||
for required_var in &listener.needed_variables {
|
||||
scope.listeners.entry(required_var.clone()).or_default().push(listener.clone());
|
||||
// debug print: if this number grows indefinetly, something is wrong, otherwise this shows that there is activity
|
||||
// TODO: remove
|
||||
log::info!("{:?} listeners for {required_var}", scope.listeners.get(&required_var.clone()).map(|x| x.len()));
|
||||
}
|
||||
|
||||
let required_variables = self.lookup_variables_in_scope(scope_index, &listener.needed_variables)?;
|
||||
|
@ -306,13 +306,14 @@ fn build_children_special_widget(
|
||||
.children
|
||||
.get(nth_value as usize)
|
||||
.with_context(|| format!("No child at index {}", nth_value))?;
|
||||
let new_child_widget = build_gtk_widget(
|
||||
tree,
|
||||
widget_defs.clone(),
|
||||
custom_widget_invocation.scope,
|
||||
nth_child_widget_use.clone(),
|
||||
None,
|
||||
let scope = tree.register_new_scope(
|
||||
format!("child {nth_value}"),
|
||||
Some(custom_widget_invocation.scope),
|
||||
calling_scope,
|
||||
HashMap::new(),
|
||||
)?;
|
||||
let new_child_widget =
|
||||
build_gtk_widget(tree, widget_defs.clone(), scope, nth_child_widget_use.clone(), None)?;
|
||||
child_container.children().iter().for_each(|f| child_container.remove(f));
|
||||
child_container.set_child(Some(&new_child_widget));
|
||||
new_child_widget.show();
|
||||
@ -323,7 +324,13 @@ fn build_children_special_widget(
|
||||
)?;
|
||||
} else {
|
||||
for child in &custom_widget_invocation.children {
|
||||
let child_widget = build_gtk_widget(tree, widget_defs.clone(), custom_widget_invocation.scope, child.clone(), None)?;
|
||||
let scope = tree.register_new_scope(
|
||||
String::from("child"),
|
||||
Some(custom_widget_invocation.scope),
|
||||
calling_scope,
|
||||
HashMap::new(),
|
||||
)?;
|
||||
let child_widget = build_gtk_widget(tree, widget_defs.clone(), scope, child.clone(), None)?;
|
||||
gtk_container.add(&child_widget);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user