feat: display WPS hint only when WPS is available
This commit is contained in:
parent
a046692241
commit
82ca8bab37
2 changed files with 34 additions and 24 deletions
|
|
@ -981,30 +981,34 @@ impl cosmic::Application for CosmicNetworkApplet {
|
|||
.spacing(12),
|
||||
);
|
||||
content = content.push(id);
|
||||
let col = padded_control(
|
||||
column![
|
||||
text::body(fl!("enter-password")),
|
||||
text_input::secure_input(
|
||||
"",
|
||||
password,
|
||||
Some(Message::TogglePasswordVisibility),
|
||||
*password_hidden,
|
||||
)
|
||||
.on_input(Message::Password)
|
||||
.on_paste(Message::Password)
|
||||
.on_submit(Message::SubmitPassword),
|
||||
container(text::body(fl!("router-wps-button"))).padding(8),
|
||||
row![
|
||||
button::standard(fl!("cancel"))
|
||||
.on_press(Message::CancelNewConnection),
|
||||
button::suggested(fl!("connect")).on_press(Message::SubmitPassword)
|
||||
]
|
||||
.spacing(24)
|
||||
]
|
||||
.spacing(8)
|
||||
.align_x(Alignment::Center),
|
||||
let enter_password_col = column![
|
||||
text::body(fl!("enter-password")),
|
||||
text_input::secure_input(
|
||||
"",
|
||||
password,
|
||||
Some(Message::TogglePasswordVisibility),
|
||||
*password_hidden,
|
||||
)
|
||||
.on_input(Message::Password)
|
||||
.on_paste(Message::Password)
|
||||
.on_submit(Message::SubmitPassword)
|
||||
.password(),
|
||||
]
|
||||
.push_maybe(
|
||||
access_point
|
||||
.wps_push
|
||||
.then(|| container(text::body(fl!("router-wps-button"))).padding(8)),
|
||||
)
|
||||
.align_x(Alignment::Center);
|
||||
.push(
|
||||
row![
|
||||
button::standard(fl!("cancel")).on_press(Message::CancelNewConnection),
|
||||
button::suggested(fl!("connect")).on_press(Message::SubmitPassword)
|
||||
]
|
||||
.spacing(24),
|
||||
);
|
||||
let col =
|
||||
padded_control(enter_password_col.spacing(8).align_x(Alignment::Center))
|
||||
.align_x(Alignment::Center);
|
||||
content = content.push(col);
|
||||
}
|
||||
NewConnectionState::Waiting(access_point) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue