feat: add combobox filter
This commit is contained in:
@@ -11,7 +11,7 @@ use gpui::{
|
||||
DispatchPhase, ElementId, Entity, EntityInputHandler, EventEmitter, Font, HitboxBehavior,
|
||||
InteractiveElement as _, IntoElement, KeyBinding, KeyDownEvent, MouseButton, MouseDownEvent,
|
||||
MouseMoveEvent, MouseUpEvent, ParentElement as _, Pixels, RenderOnce, Role, ScrollDelta,
|
||||
ScrollEvent, SharedString, StatefulInteractiveElement as _, Styled as _, Subscription,
|
||||
ScrollEvent, SharedString, StatefulInteractiveElement as _, Styled as _, Subscription, Task,
|
||||
TextAlign, TextRun, UTF16Selection, Window, WrappedLine, actions, canvas, div, fill, point, px,
|
||||
};
|
||||
use gpui_native_icons::IconRole;
|
||||
@@ -483,6 +483,8 @@ struct CaretBlink {
|
||||
visible: bool,
|
||||
active: bool,
|
||||
paused: bool,
|
||||
/// Pending blink timers; held so they die with the controller.
|
||||
tasks: Vec<Task<()>>,
|
||||
}
|
||||
|
||||
impl CaretBlink {
|
||||
@@ -493,6 +495,7 @@ impl CaretBlink {
|
||||
visible: true,
|
||||
active: false,
|
||||
paused: false,
|
||||
tasks: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,7 +553,7 @@ impl CaretBlink {
|
||||
fn schedule_pause(&mut self, cx: &mut Context<Self>) {
|
||||
let generation = self.generation;
|
||||
let interval = self.interval;
|
||||
cx.spawn(async move |this, cx| {
|
||||
let task = cx.spawn(async move |this, cx| {
|
||||
cx.background_executor().timer(interval).await;
|
||||
this.update(cx, |this, cx| {
|
||||
if this.generation == generation {
|
||||
@@ -558,8 +561,9 @@ impl CaretBlink {
|
||||
this.tick(cx);
|
||||
}
|
||||
})
|
||||
})
|
||||
.detach();
|
||||
.ok();
|
||||
});
|
||||
self.tasks.push(task);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user