Skip to main content

PasswordBox

Struct PasswordBox 

Source
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: TextEditingControllerRef

Owns 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: String

Text displayed while the controller is empty.

§is_enabled: bool

Whether 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: bool

Requests initial keyboard focus through the native editor.

§context_menu_builder: Option<EditableTextContextMenuBuilder>

Overrides the desktop text-command menu.

§password_reveal_mode: PasswordRevealMode

Controls whether the password can be temporarily revealed, stays hidden, or stays visible.

§password_char: char

The 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

Source

pub fn new(controller: TextEditingControllerRef) -> Self

Creates an editor using a caller-owned native editing controller.

Source

pub fn focus_node(self, value: FocusNodeRef) -> Self

Sets FocusNode.

Source

pub fn header<K>(self, value: impl IntoWidget<K>) -> Self

Sets Header.

Source

pub fn description<K>(self, value: impl IntoWidget<K>) -> Self

Sets Description.

Source

pub fn placeholder_text(self, value: impl Into<String>) -> Self

Sets PlaceholderText.

Source

pub fn is_enabled(self, value: bool) -> Self

Sets IsEnabled.

Source

pub fn font_size(self, value: f64) -> Self

Sets FontSize.

Source

pub fn padding(self, value: [f64; 4]) -> Self

Sets Padding.

Source

pub fn corner_radius(self, value: f64) -> Self

Sets CornerRadius.

Source

pub fn foreground(self, value: Color) -> Self

Sets Foreground.

Source

pub fn background(self, value: Brush) -> Self

Sets Background.

Source

pub fn border_brush(self, value: Brush) -> Self

Sets BorderBrush.

Source

pub fn selection_highlight_color(self, value: Color) -> Self

Sets SelectionHighlightColor.

Source

pub fn max_length(self, value: i32) -> Self

Sets MaxLength.

Source

pub fn input_formatters(self, value: Vec<TextInputFormatterRef>) -> Self

Sets InputFormatters.

Source

pub fn autofocus(self, value: bool) -> Self

Sets Autofocus.

Source

pub fn context_menu_builder( self, value: impl Fn(&mut App, BuildContext, Handle<EditableTextState>) -> WidgetRef + 'static, ) -> Self

Sets ContextMenuBuilder.

Source

pub fn password_reveal_mode(self, value: PasswordRevealMode) -> Self

Sets PasswordRevealMode.

Source

pub fn password_char(self, value: char) -> Self

Sets PasswordChar.

Source

pub fn password_changed( self, value: impl Fn(&mut App, String) + 'static, ) -> Self

Sets PasswordChanged.

Source

pub fn key(self, key: KeyRef) -> Self

Sets widget identity.

Trait Implementations§

Source§

impl Clone for PasswordBox

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PasswordBox

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StatelessWidget for PasswordBox

Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef

Describes the part of the user interface represented by this widget. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s 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)

Dart’s constructor asserts that relate two or more arguments. Read more
Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Dart’s 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 PasswordBox
where 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 PasswordBox
where 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 PasswordBox
where 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<StatelessKind> for W
where W: StatelessWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>