Skip to main content

zng_wgt_text_input/
lib.rs

1#![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")]
2#![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")]
3//!
4//! Text input and label widgets.
5//!
6//! # Crate
7//!
8#![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))]
9#![warn(unused_extern_crates)]
10#![warn(missing_docs)]
11
12zng_wgt::enable_widget_macros!();
13
14pub mod label;
15pub mod selectable;
16
17mod text_input;
18pub use text_input::*;
19
20zng_env::on_process_start!(|_| {
21    zng_wgt_menu::MENU_TEXT_INPUT.init_label(menu_label, set_menu_label_style);
22});
23fn menu_label(txt: zng_var::Var<zng_wgt::prelude::Txt>) -> zng_app::widget::node::UiNode {
24    label::Label! {
25        txt;
26    }
27}
28fn set_menu_label_style(wgt: &mut zng_wgt_style::Style) {
29    zng_app::widget_set! {
30        wgt;
31        label::style_fn = zng_wgt_style::style_fn!(|_| label::DefaultStyle! {
32            label::mnemonic_underline = true;
33            zng_wgt_text::underline = 1, zng_app::widget::border::LineStyle::Solid;
34        });
35    }
36}