anvil.window_map: add WindowMap::set_location
This commit is contained in:
parent
a51e421c19
commit
0ea4ec9abe
|
@ -242,4 +242,12 @@ where
|
||||||
.find(|w| w.toplevel.equals(toplevel))
|
.find(|w| w.toplevel.equals(toplevel))
|
||||||
.map(|w| w.location)
|
.map(|w| w.location)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the location of the toplevel, if it exists.
|
||||||
|
pub fn set_location(&mut self, toplevel: &Kind<R>, location: (i32, i32)) {
|
||||||
|
if let Some(w) = self.windows.iter_mut().find(|w| w.toplevel.equals(toplevel)) {
|
||||||
|
w.location = location;
|
||||||
|
w.self_update(self.ctoken, &self.get_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue