pub enum EchoMode {
Normal,
Password,
NoEcho,
}Expand description
How a text input renders its content - Qt’s
QLineEdit::EchoMode.
The mode is a display + clipboard policy only: the underlying
TextContent / crate::text_model::TextBuffer always holds the
real plaintext so editing, caret motion, undo, and IME keep operating
on the true value. extract_text substitutes the display glyphs;
lumen_input::type_into_focused gates the clipboard.
- Spawned by
<input type="password">markup (wired by the reconciler onto the same entity that carriesTextInput). - Absent component =>
EchoMode::Normal.
Variants§
Normal
Show the text verbatim (default). Copy / cut are allowed.
Password
Render every scalar as PASSWORD_MASK_CHAR; the plaintext stays
in the buffer for editing. Copy / cut are blocked (Qt disables
them for non-Normal echo modes so a password can’t be lifted off
the clipboard); paste and select-all still work.
NoEcho
Render nothing at all (not even length). Same clipboard block as
EchoMode::Password.
Implementations§
Source§impl EchoMode
impl EchoMode
Sourcepub fn is_concealed(self) -> bool
pub fn is_concealed(self) -> bool
true when the mode conceals the content: copy must be suppressed
and the glyphs masked.
Sourcepub fn display_string(self, plain: &str) -> Cow<'_, str>
pub fn display_string(self, plain: &str) -> Cow<'_, str>
The run actually drawn for the plaintext plain.
Measuring, hit-testing, and drawing must all agree on one string, so this is what the shaping producer shapes for a concealed field.
Sourcepub fn display_offset(self, plain: &str, plain_byte: usize) -> usize
pub fn display_offset(self, plain: &str, plain_byte: usize) -> usize
Byte offset into Self::display_string for a plaintext byte
offset. Snaps plain_byte down to a code point boundary first.
Sourcepub fn plain_offset(self, plain: &str, display_byte: usize) -> usize
pub fn plain_offset(self, plain: &str, display_byte: usize) -> usize
Inverse of Self::display_offset: plaintext byte offset for a byte
offset into the displayed run.
Trait Implementations§
Source§impl Component for EchoMode
impl Component for EchoMode
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)
fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
impl Copy for EchoMode
impl Eq for EchoMode
impl StructuralPartialEq for EchoMode
Auto Trait Implementations§
impl Freeze for EchoMode
impl RefUnwindSafe for EchoMode
impl Send for EchoMode
impl Sync for EchoMode
impl Unpin for EchoMode
impl UnsafeUnpin for EchoMode
impl UnwindSafe for EchoMode
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.