1
0
Fork 0
forked from wry/wry

create event system

This commit is contained in:
atagen 2026-04-07 16:13:45 +10:00
parent 21819e27d2
commit 18a0c78657
9 changed files with 65 additions and 5 deletions

View file

@ -20,8 +20,8 @@ use {
},
utils::{
asyncevent::AsyncEvent, clonecell::CloneCell, double_click_state::DoubleClickState,
errorfmt::ErrorFmt, linkedlist::LinkedNode, on_drop_event::OnDropEvent,
smallmap::SmallMapMut,
errorfmt::ErrorFmt, event_listener::LazyEventSource, linkedlist::LinkedNode,
on_drop_event::OnDropEvent, smallmap::SmallMapMut,
},
},
ahash::AHashMap,
@ -56,6 +56,7 @@ pub struct FloatNode {
pub title_textures: RefCell<SmallMapMut<Scale, TextTexture, 2>>,
cursors: RefCell<AHashMap<CursorType, CursorState>>,
pub attention_requested: Cell<bool>,
pub layout_complete: Rc<LazyEventSource>,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
@ -136,6 +137,7 @@ impl FloatNode {
title_textures: Default::default(),
cursors: Default::default(),
attention_requested: Cell::new(false),
layout_complete: state.post_layout_event_sources.create_source(),
});
floater.pull_child_properties();
*floater.display_link.borrow_mut() = Some(state.root.stacked.add_last(floater.clone()));
@ -190,6 +192,7 @@ impl FloatNode {
self.title_rect.set(tr);
self.layout_scheduled.set(false);
self.schedule_render_titles();
self.layout_complete.trigger();
}
pub fn schedule_render_titles(self: &Rc<Self>) {