use a builder for PassphraseInput
This commit is contained in:
1 parent
39b3f74068
commit
c1186ad55e
4 files changed
+69
-37
No files matched your search
@@ -26,8 +26,14 @@ pub struct WelcomeScreen {
|
||||
impl WelcomeScreen {
|
||||
pub fn new(window: &mut Window, cx: &mut Context<Self>) -> Self {
|
||||
let show = cx.new(|_| false);
|
||||
let passphrase = cx.new(|cx| PassphraseInput::new("passphrase", show.clone(), window, cx));
|
||||
let confirm = cx.new(|cx| PassphraseInput::new("confirm", show, window, cx));
|
||||
let passphrase = PassphraseInput::builder("passphrase")
|
||||
.show(show.clone())
|
||||
.placeholder("correct horse battery staple")
|
||||
.build(window, cx);
|
||||
let confirm = PassphraseInput::builder("confirm")
|
||||
.show(show)
|
||||
.placeholder("correct horse battery staple")
|
||||
.build(window, cx);
|
||||
passphrase.update(cx, |input, cx| input.focus(window, cx));
|
||||
|
||||
let mut _subscriptions = Vec::new();
|
||||
|
||||
Reference in new issue
Block a user