work
This commit is contained in:
@@ -8,9 +8,9 @@ impl<Rsc: HasEvents, W: Widget + 'static> WidgetAttr<Rsc, W> for Selector
|
||||
where
|
||||
Rsc::State: HasDefaultUiState,
|
||||
{
|
||||
type Input = WidgetRef<TextEdit>;
|
||||
type Input = WeakWidget<TextEdit>;
|
||||
|
||||
fn run(rsc: &mut Rsc, container: WidgetRef<W>, id: Self::Input) {
|
||||
fn run(rsc: &mut Rsc, container: WeakWidget<W>, id: Self::Input) {
|
||||
rsc.register_event(container, CursorSense::click_or_drag(), move |ctx, rsc| {
|
||||
let region = rsc.ui().window_region(&id).unwrap();
|
||||
let id_pos = region.top_left;
|
||||
@@ -30,7 +30,7 @@ where
|
||||
{
|
||||
type Input = ();
|
||||
|
||||
fn run(rsc: &mut Rsc, id: WidgetRef<TextEdit>, _: Self::Input) {
|
||||
fn run(rsc: &mut Rsc, id: WeakWidget<TextEdit>, _: Self::Input) {
|
||||
rsc.register_event(id, CursorSense::click_or_drag(), move |ctx, rsc| {
|
||||
select(
|
||||
rsc,
|
||||
@@ -47,7 +47,7 @@ where
|
||||
fn select(
|
||||
rsc: &mut impl HasUi,
|
||||
state: &mut impl HasDefaultUiState,
|
||||
id: WidgetRef<TextEdit>,
|
||||
id: WeakWidget<TextEdit>,
|
||||
pos: Vec2,
|
||||
size: Vec2,
|
||||
dragging: bool,
|
||||
|
||||
@@ -32,7 +32,7 @@ pub type Proxy<Event> = EventLoopProxy<Event>;
|
||||
pub struct DefaultUiState {
|
||||
pub renderer: UiRenderer,
|
||||
pub input: Input,
|
||||
pub focus: Option<WidgetRef<TextEdit>>,
|
||||
pub focus: Option<WeakWidget<TextEdit>>,
|
||||
pub clipboard: Clipboard,
|
||||
pub window: Arc<Window>,
|
||||
pub ime: usize,
|
||||
|
||||
Reference in New Issue
Block a user