Add support for resizing splits and docks, as well as utilities (#3595)

Making this PR to upstream changes to util and GPUI2, resizing exists
but isn't working yet.

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2023-12-11 13:32:06 -08:00 committed by GitHub
commit 927d18b0f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 976 additions and 512 deletions

View file

@ -60,6 +60,16 @@ pub enum DispatchPhase {
Capture,
}
impl DispatchPhase {
pub fn bubble(self) -> bool {
self == DispatchPhase::Bubble
}
pub fn capture(self) -> bool {
self == DispatchPhase::Capture
}
}
type AnyObserver = Box<dyn FnMut(&mut WindowContext) -> bool + 'static>;
type AnyMouseListener = Box<dyn FnMut(&dyn Any, DispatchPhase, &mut WindowContext) + 'static>;
type AnyFocusListener = Box<dyn Fn(&FocusEvent, &mut WindowContext) + 'static>;
@ -866,7 +876,7 @@ impl<'a> WindowContext<'a> {
/// same layer as the given stacking order.
pub fn was_top_layer(&self, point: &Point<Pixels>, level: &StackingOrder) -> bool {
for (stack, bounds) in self.window.rendered_frame.depth_map.iter() {
if bounds.contains_point(point) {
if bounds.contains(point) {
return level.starts_with(stack) || stack.starts_with(level);
}
}