core: add read only builder option to input state

This commit is contained in:
2026-11-12 08:55:05 +07:00
parent ccd8997801
commit 9678a7676f
2 changed files with 18 additions and 0 deletions
+9
View File
@@ -867,6 +867,7 @@ struct InputDemo {
password: Entity<InputState>,
notes: Entity<InputState>,
search: Entity<InputState>,
_subscriptions: Vec<gpui::Subscription>,
}
impl InputDemo {
@@ -876,11 +877,19 @@ impl InputDemo {
let notes = InputState::builder().multiline().build(cx);
let search = InputState::new(cx);
let subscriptions = vec![
cx.observe(&text, |_, _, cx| cx.notify()),
cx.observe(&password, |_, _, cx| cx.notify()),
cx.observe(&notes, |_, _, cx| cx.notify()),
cx.observe(&search, |_, _, cx| cx.notify()),
];
Self {
text,
password,
notes,
search,
_subscriptions: subscriptions,
}
}
}