Fix Popup modal mouse move crossed to back layer. (#51)

This commit is contained in:
Jason Lee 2024-07-20 02:39:27 +08:00 committed by GitHub
parent e3a49f20ca
commit ca08be7038
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View file

@ -39,11 +39,11 @@ fn main() {
cx.set_menus(vec![ cx.set_menus(vec![
Menu { Menu {
name: "GPUI App", name: "GPUI App".into(),
items: vec![MenuItem::action("Quit", Quit)], items: vec![MenuItem::action("Quit", Quit)],
}, },
Menu { Menu {
name: "Edit", name: "Edit".into(),
items: vec![MenuItem::action("Copy", Copy)], items: vec![MenuItem::action("Copy", Copy)],
}, },
]); ]);

View file

@ -1,9 +1,9 @@
use std::sync::Arc; use std::sync::Arc;
use gpui::{ use gpui::{
div, prelude::FluentBuilder as _, px, FocusHandle, FocusableView, InteractiveElement as _, deferred, div, prelude::FluentBuilder as _, px, FocusHandle, FocusableView,
IntoElement, ParentElement, Render, Styled, View, ViewContext, VisualContext as _, WeakView, InteractiveElement as _, IntoElement, ParentElement, Render, Styled, View, ViewContext,
WindowContext, VisualContext as _, WeakView, WindowContext,
}; };
use ui::{ use ui::{
@ -208,10 +208,11 @@ impl Render for PickerStory {
) )
}) })
.when(self.open, |this| { .when(self.open, |this| {
this.child( this.child(deferred(
div().absolute().size_full().top_0().left_0().child( div().absolute().size_full().top_0().left_0().child(
v_flex().flex().flex_col().items_center().child( v_flex().flex().flex_col().items_center().child(
v_flex() v_flex()
.occlude()
.w(px(450.)) .w(px(450.))
.h(px(350.)) .h(px(350.))
.elevation_3(cx) .elevation_3(cx)
@ -222,7 +223,7 @@ impl Render for PickerStory {
})), })),
), ),
), ),
) ))
}) })
} }
} }