core: add read only builder option to input state
This commit is contained in:
@@ -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(¬es, |_, _, cx| cx.notify()),
|
||||
cx.observe(&search, |_, _, cx| cx.notify()),
|
||||
];
|
||||
|
||||
Self {
|
||||
text,
|
||||
password,
|
||||
notes,
|
||||
search,
|
||||
_subscriptions: subscriptions,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user