mirror of
https://github.com/danbulant/cushy
synced 2026-05-21 13:18:48 +00:00
While this was a workaround for a docs.rs issue (Px/Lp are not linked), I decided having the shorter import path would look better in the examples. It probably wasn't necessary to update all of the references in the internal code, but I decided it was worth the consistency.
20 lines
542 B
Rust
20 lines
542 B
Rust
use cushy::value::Dynamic;
|
|
use cushy::widget::MakeWidget;
|
|
use cushy::widgets::input::{InputValue, MaskedString};
|
|
use cushy::Run;
|
|
use figures::units::Px;
|
|
|
|
fn main() -> cushy::Result {
|
|
let contents = Dynamic::from("Hello World");
|
|
let password = Dynamic::new(MaskedString::default());
|
|
|
|
"Text Input Field:"
|
|
.and(contents.into_input())
|
|
.and("Masked Input Field:")
|
|
.and(password.into_input())
|
|
.into_rows()
|
|
.width(Px::new(100)..Px::new(800))
|
|
.scroll()
|
|
.centered()
|
|
.run()
|
|
}
|