Replace top_most_layer with more flexible layer_ids (#1266)

This commit is contained in:
Friz64
2022-04-08 09:06:04 +02:00
committed by GitHub
parent 8cf196a34b
commit dd58d5175f
3 changed files with 6 additions and 11 deletions
+2 -7
View File
@@ -943,13 +943,8 @@ impl Context {
self.memory().layer_id_at(pos, resize_grab_radius_side)
}
/// The overall top-most layer. When an area is clicked on or interacted
/// with, it is moved above all other areas.
pub fn top_most_layer(&self) -> Option<LayerId> {
self.memory().top_most_layer()
}
/// Moves the given area to the top.
/// Moves the given area to the top in its [`Order`].
/// [`Area`]:s and [`Window`]:s also do this automatically when being clicked on or interacted with.
pub fn move_to_top(&self, layer_id: LayerId) {
self.memory().areas.move_to_top(layer_id);
}
+3 -4
View File
@@ -329,10 +329,9 @@ impl Memory {
self.areas.layer_id_at(pos, resize_interact_radius_side)
}
/// The overall top-most layer. When an area is clicked on or interacted
/// with, it is moved above all other areas.
pub fn top_most_layer(&self) -> Option<LayerId> {
self.areas.order().last().copied()
/// An iterator over all layers. Back-to-front. Top is last.
pub fn layer_ids(&self) -> impl ExactSizeIterator<Item = LayerId> + '_ {
self.areas.order().iter().copied()
}
pub(crate) fn had_focus_last_frame(&self, id: Id) -> bool {