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

Store/restore emigui memory state (window positions, sizes etc)

This commit is contained in:
Emil Ernerfeldt
2020-05-02 11:37:12 +02:00
parent d52cccde7b
commit bfbb669d02
19 changed files with 154 additions and 60 deletions

View File

@@ -1,9 +1,9 @@
#![allow(unused_variables)] // TODO
use crate::*;
#[derive(Clone, Copy, Debug)]
pub struct State {
pub size: Vec2,
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub(crate) struct State {
size: Vec2,
}
// TODO: auto-shink/grow should be part of another container!
@@ -229,7 +229,7 @@ impl Resize {
paint_resize_corner(region, &corner_rect, &corner_interact);
if corner_interact.hovered || corner_interact.active {
region.ctx().output.lock().cursor_icon = CursorIcon::ResizeNwSe;
region.ctx().output().cursor_icon = CursorIcon::ResizeNwSe;
}
region.memory().resize.insert(id, state);