Add high-prio TODO to refactor layer system

This commit is contained in:
Emil Ernerfeldt 2020-10-21 22:20:30 +02:00
parent 35b949a2d8
commit 46e39d3dd9
2 changed files with 6 additions and 9 deletions

View file

@ -5,8 +5,7 @@ TODO-list for the Egui project. If you looking for something to do, look here.
## Top priority
* Text input: text selection etc
* Fix `is_mouse_over_area()` for menu bar:
* Probably a good time to create some sort of `ctx.top_panel()` allocation system and refactor paint layers
* Refactor graphics layers and areas so one don't have to register LayerId:s.
## Other

View file

@ -267,12 +267,10 @@ impl Context {
/// A `Ui` for the entire screen, behind any windows.
fn fullscreen_ui(self: &Arc<Self>) -> Ui {
let rect = self.input.screen_rect();
let id = Id::background();
let layer_id = LayerId {
order: Order::Background,
id,
};
// Ensure we register the background area so it is painted:
let layer_id = LayerId::background();
// Ensure we register the background area so it is painted
// and so we handle interactions properly (clicks on it etc).
// TODO: we shouldn't need to register areas. Maybe GraphicLayers should take care of it?
self.memory().areas.set_state(
layer_id,
containers::area::State {
@ -282,7 +280,7 @@ impl Context {
vel: Default::default(),
},
);
Ui::new(self.clone(), layer_id, id, rect, rect)
Ui::new(self.clone(), layer_id, layer_id.id, rect, rect)
}
// ---------------------------------------------------------------------