1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Implement window resizing

This commit is contained in:
Emil Ernerfeldt
2020-04-19 23:34:34 +02:00
parent 1be828bbe3
commit 388132ba93
8 changed files with 202 additions and 31 deletions

View File

@@ -29,8 +29,16 @@ impl Memory {
}
}
/// default_rect: where to put it if it does NOT exist
pub fn get_window(&mut self, id: Id) -> Option<WindowState> {
self.windows.get(&id).cloned()
}
pub fn set_window_state(&mut self, id: Id, state: WindowState) {
self.windows.insert(id, state);
let did_insert = self.windows.insert(id, state).is_none();
if did_insert {
self.window_order.push(id);
}
}
pub fn layer_at(&self, pos: Pos2) -> Layer {