pub enum OverlayIntent {
Show {
anchor: OverlayAnchor,
node: WidgetNode,
focus: OverlayFocus,
},
Hide(OverlayRef),
Update {
r: OverlayRef,
node: WidgetNode,
},
}Expand description
overlay 意图 —— state 的“计划“,由 ElementTree 在帧末统一执行
Variants§
Show
打开一个 overlay 子树
Fields
§
anchor: OverlayAnchor定位锚点策略(Point 直接用;Element 由 tree 在执行期解析)
§
node: WidgetNodeoverlay 子树 —— 由组件侧完全自己构造好,core 不关心内部长什么样
§
focus: OverlayFocus焦点策略(Passive = Tooltip 型,Modal = Dialog/菜单型)
Hide(OverlayRef)
关闭 overlay
Update
就地替换已显示 overlay 的子树(State / 焦点 / 锚点保留,只重排与重新定位)。
异步数据源必需:面板开着的时候数据才到达(Loading → Ready),
没有它就得 Hide+Show —— 滚动位置、hover、键盘 active 全部丢失,还会闪一下。
handle 已被关闭时静默忽略。
Trait Implementations§
Source§impl Clone for OverlayIntent
impl Clone for OverlayIntent
Auto Trait Implementations§
impl !RefUnwindSafe for OverlayIntent
impl !Send for OverlayIntent
impl !Sync for OverlayIntent
impl !UnwindSafe for OverlayIntent
impl Forget for OverlayIntent
impl Freeze for OverlayIntent
impl Move for OverlayIntent
impl Unpin for OverlayIntent
impl UnsafeUnpin for OverlayIntent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more