migrate input

This commit is contained in:
2026-09-17 16:12:31 +07:00
parent 7118565b4d
commit 75a25a9a9d
27 changed files with 219 additions and 7016 deletions
-15
View File
@@ -3,7 +3,6 @@ use std::rc::Rc;
use gpui::{App, ElementId, Entity, Window};
use crate::Root;
use crate::input::InputState;
use crate::modal::Modal;
use crate::notification::Notification;
@@ -43,12 +42,6 @@ pub trait WindowExtension: Sized {
/// Clear all notifications
fn clear_notifications(&mut self, cx: &mut App);
/// Return current focused Input entity.
fn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>>;
/// Returns true if there is a focused Input entity.
fn has_focused_input(&mut self, cx: &mut App) -> bool;
}
impl WindowExtension for Window {
@@ -122,12 +115,4 @@ impl WindowExtension for Window {
let entity = Root::read(self, cx).notification.clone();
Rc::new(entity.read(cx).notifications())
}
fn has_focused_input(&mut self, cx: &mut App) -> bool {
Root::read(self, cx).focused_input.is_some()
}
fn focused_input(&mut self, cx: &mut App) -> Option<Entity<InputState>> {
Root::read(self, cx).focused_input.clone()
}
}