autocommit 2022-04-23 01:40:39 CEST
This commit is contained in:
parent
e3b3d848c3
commit
025efbaccc
4 changed files with 19 additions and 45 deletions
|
|
@ -26,7 +26,6 @@ use {
|
|||
},
|
||||
},
|
||||
ahash::AHashMap,
|
||||
backtrace::Backtrace,
|
||||
isnt::std_1::vec::IsntVecExt,
|
||||
jay_config::{Axis, Direction},
|
||||
smallvec::SmallVec,
|
||||
|
|
@ -280,7 +279,6 @@ impl ContainerNode {
|
|||
let mut links = self.child_nodes.borrow_mut();
|
||||
if links.contains_key(&new.node_id()) {
|
||||
log::error!("Tried to add a child to a container that already contains the child");
|
||||
log::error!("\n{:?}", Backtrace::new());
|
||||
return;
|
||||
}
|
||||
let link = f(ContainerChild {
|
||||
|
|
@ -942,6 +940,16 @@ impl Node for ContainerNode {
|
|||
self.toplevel_data.visible.get()
|
||||
}
|
||||
|
||||
fn node_absolute_position(&self) -> Rect {
|
||||
Rect::new_sized(
|
||||
self.abs_x1.get(),
|
||||
self.abs_y1.get(),
|
||||
self.width.get(),
|
||||
self.height.get(),
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn node_child_title_changed(self: Rc<Self>, child: &dyn Node, title: &str) {
|
||||
let child = match self.child_nodes.borrow_mut().get(&child.node_id()) {
|
||||
Some(cn) => cn.to_ref(),
|
||||
|
|
@ -980,16 +988,6 @@ impl Node for ContainerNode {
|
|||
}
|
||||
}
|
||||
|
||||
fn node_absolute_position(&self) -> Rect {
|
||||
Rect::new_sized(
|
||||
self.abs_x1.get(),
|
||||
self.abs_y1.get(),
|
||||
self.width.get(),
|
||||
self.height.get(),
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn node_active_changed(&self, active: bool) {
|
||||
self.toplevel_data.active.set(active);
|
||||
self.parent.get().node_child_active_changed(self, active, 1);
|
||||
|
|
@ -1316,6 +1314,10 @@ impl ToplevelNode for ContainerNode {
|
|||
.map(|tl| tl.tl_into_node())
|
||||
}
|
||||
|
||||
fn tl_after_parent_set(&self, parent: Rc<dyn ContainingNode>) {
|
||||
self.parent.set(parent);
|
||||
}
|
||||
|
||||
fn tl_set_workspace(self: Rc<Self>, ws: &Rc<WorkspaceNode>) {
|
||||
self.toplevel_data.workspace.set(Some(ws.clone()));
|
||||
for child in self.children.iter() {
|
||||
|
|
@ -1381,10 +1383,6 @@ impl ToplevelNode for ContainerNode {
|
|||
}
|
||||
self
|
||||
}
|
||||
|
||||
fn tl_after_parent_set(&self, parent: Rc<dyn ContainingNode>) {
|
||||
self.parent.set(parent);
|
||||
}
|
||||
}
|
||||
|
||||
fn direction_to_split(dir: Direction) -> (ContainerSplit, bool) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ impl PlaceholderNode {
|
|||
pub fn new_for(state: &Rc<State>, node: Rc<dyn ToplevelNode>) -> Self {
|
||||
Self {
|
||||
id: state.node_ids.next(),
|
||||
toplevel: ToplevelData::new(state, node.tl_title(), node.node_client()),
|
||||
toplevel: ToplevelData::new(state, node.tl_data().title.borrow_mut().clone(), node.node_client()),
|
||||
destroyed: Default::default(),
|
||||
texture: Default::default(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,10 +71,6 @@ pub trait ToplevelNode: Node {
|
|||
}
|
||||
}
|
||||
|
||||
fn tl_title(&self) -> String {
|
||||
self.tl_data().title.borrow_mut().clone()
|
||||
}
|
||||
|
||||
fn tl_title_changed(&self) {
|
||||
let data = self.tl_data();
|
||||
let title = data.title.borrow_mut();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue