pub struct PasswordBox {Show 21 fields
pub controller: TextEditingControllerRef,
pub focus_node: Option<FocusNodeRef>,
pub header: Option<WidgetRef>,
pub description: Option<WidgetRef>,
pub placeholder_text: String,
pub is_enabled: bool,
pub font_size: Option<f64>,
pub padding: Option<[f64; 4]>,
pub corner_radius: Option<f64>,
pub foreground: Option<Color>,
pub background: Option<Brush>,
pub border_brush: Option<Brush>,
pub selection_highlight_color: Option<Color>,
pub max_length: Option<i32>,
pub input_formatters: Vec<TextInputFormatterRef>,
pub autofocus: bool,
pub context_menu_builder: Option<EditableTextContextMenuBuilder>,
pub password_reveal_mode: PasswordRevealMode,
pub password_char: char,
pub password_changed: Option<TextChangedCallback>,
pub key: Option<KeyRef>,
}Expand description
The WinUI PasswordBox control with its default Fluent template.
Fields§
§controller: TextEditingControllerRefOwns the text, selection and composing range; the caller retains and disposes it.
focus_node: Option<FocusNodeRef>An optional caller-owned focus node; otherwise the control creates one.
header: Option<WidgetRef>Content above the editor, with the source header margin.
description: Option<WidgetRef>Supporting content below the editor.
placeholder_text: StringText displayed while the controller is empty.
is_enabled: boolWhether the editor accepts pointer and keyboard input.
font_size: Option<f64>The editor font size and basis of the helper-button width threshold; the theme’s ControlContentThemeFontSize when None.
padding: Option<[f64; 4]>Editor padding in left, top, right, bottom order; the theme’s TextControlThemePadding when None.
corner_radius: Option<f64>The template border and helper-button corner radius.
foreground: Option<Color>Overrides the normal editor foreground; visual states use their source theme resources.
background: Option<Brush>Overrides the normal editor background.
border_brush: Option<Brush>Overrides the normal editor border brush.
selection_highlight_color: Option<Color>Overrides the selection fill while the editor has focus.
max_length: Option<i32>Limits user edits through the native length formatter; programmatic assignments remain unrestricted.
input_formatters: Vec<TextInputFormatterRef>Native formatters applied to user edits, following Flutter composition and undo behavior.
autofocus: boolRequests initial keyboard focus through the native editor.
Overrides the desktop text-command menu.
password_reveal_mode: PasswordRevealModeControls whether the password can be temporarily revealed, stays hidden, or stays visible.
password_char: charThe character displayed for each concealed password character.
password_changed: Option<TextChangedCallback>Receives user password edits; listen to the controller for programmatic assignments.
key: Option<KeyRef>Identity retained across parent rebuilds.
Implementations§
Source§impl PasswordBox
impl PasswordBox
Sourcepub fn new(controller: TextEditingControllerRef) -> Self
pub fn new(controller: TextEditingControllerRef) -> Self
Creates an editor using a caller-owned native editing controller.
Sourcepub fn focus_node(self, value: FocusNodeRef) -> Self
pub fn focus_node(self, value: FocusNodeRef) -> Self
Sets FocusNode.
Sourcepub fn header<K>(self, value: impl IntoWidget<K>) -> Self
pub fn header<K>(self, value: impl IntoWidget<K>) -> Self
Sets Header.
Sourcepub fn description<K>(self, value: impl IntoWidget<K>) -> Self
pub fn description<K>(self, value: impl IntoWidget<K>) -> Self
Sets Description.
Sourcepub fn placeholder_text(self, value: impl Into<String>) -> Self
pub fn placeholder_text(self, value: impl Into<String>) -> Self
Sets PlaceholderText.
Sourcepub fn is_enabled(self, value: bool) -> Self
pub fn is_enabled(self, value: bool) -> Self
Sets IsEnabled.
Sourcepub fn corner_radius(self, value: f64) -> Self
pub fn corner_radius(self, value: f64) -> Self
Sets CornerRadius.
Sourcepub fn foreground(self, value: Color) -> Self
pub fn foreground(self, value: Color) -> Self
Sets Foreground.
Sourcepub fn background(self, value: Brush) -> Self
pub fn background(self, value: Brush) -> Self
Sets Background.
Sourcepub fn border_brush(self, value: Brush) -> Self
pub fn border_brush(self, value: Brush) -> Self
Sets BorderBrush.
Sourcepub fn selection_highlight_color(self, value: Color) -> Self
pub fn selection_highlight_color(self, value: Color) -> Self
Sets SelectionHighlightColor.
Sourcepub fn max_length(self, value: i32) -> Self
pub fn max_length(self, value: i32) -> Self
Sets MaxLength.
Sourcepub fn input_formatters(self, value: Vec<TextInputFormatterRef>) -> Self
pub fn input_formatters(self, value: Vec<TextInputFormatterRef>) -> Self
Sets InputFormatters.
Sets ContextMenuBuilder.
Sourcepub fn password_reveal_mode(self, value: PasswordRevealMode) -> Self
pub fn password_reveal_mode(self, value: PasswordRevealMode) -> Self
Sets PasswordRevealMode.
Sourcepub fn password_char(self, value: char) -> Self
pub fn password_char(self, value: char) -> Self
Sets PasswordChar.
Sourcepub fn password_changed(
self,
value: impl Fn(&mut App, String) + 'static,
) -> Self
pub fn password_changed( self, value: impl Fn(&mut App, String) + 'static, ) -> Self
Sets PasswordChanged.
Trait Implementations§
Source§impl Clone for PasswordBox
impl Clone for PasswordBox
Source§impl Debug for PasswordBox
impl Debug for PasswordBox
Source§impl StatelessWidget for PasswordBox
impl StatelessWidget for PasswordBox
Source§fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for PasswordBox
impl !Send for PasswordBox
impl !Sync for PasswordBox
impl !UnwindSafe for PasswordBox
impl Forget for PasswordBox
impl Freeze for PasswordBoxwhere
NonZero<u32>: Freeze,
&'static TextEditingControllerVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
&'static FocusNodeVTable: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TextInputFormatterRef>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(&mut App, String)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, String)>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for PasswordBox
impl Unpin for PasswordBoxwhere
NonZero<u32>: Unpin,
&'static TextEditingControllerVTable: Unpin,
Rc<Keep>: Unpin,
&'static FocusNodeVTable: Unpin,
Rc<dyn Widget>: Unpin,
*const u8 is !null: Unpin,
Rc<dyn TextInputFormatter>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(&mut App, String)>: Unpin,
Rc<dyn Key>: Unpin,
impl UnsafeUnpin for PasswordBoxwhere
NonZeroU32Inner: UnsafeUnpin,
&'static TextEditingControllerVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
&'static FocusNodeVTable: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TextInputFormatterRef>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, String)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, String)>>: UnsafeUnpin,
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.