pub struct EditFlags {
pub has_selection: bool,
pub can_undo: bool,
pub can_redo: bool,
pub can_paste: bool,
pub has_text: bool,
pub masked: bool,
}Expand description
Banderas que deciden qué ítems van habilitados. Derivalas del estado
del campo focuseado con EditFlags::from_editor.
Fields§
§has_selection: boolHay selección no-vacía → Cortar/Copiar/Eliminar habilitados.
can_undo: boolHay algo que deshacer.
can_redo: boolHay algo que rehacer.
can_paste: boolEl clipboard tiene contenido pegable → Pegar habilitado. Si no se
puede saber barato, pasá true (Pegar no-opea si está vacío).
has_text: boolEl buffer no está vacío → Seleccionar todo habilitado.
masked: boolCampo enmascarado (password): Cortar/Copiar se deshabilitan para no filtrar el secreto al clipboard.
Implementations§
Source§impl EditFlags
impl EditFlags
Sourcepub fn from_editor(state: &EditorState, masked: bool) -> Self
pub fn from_editor(state: &EditorState, masked: bool) -> Self
Deriva las banderas del estado del editor. can_paste se deja en
true (consultar el clipboard real requiere &mut; pegar vacío
es no-op). masked lo decide el caller (el input lo sabe vía
TextInputState::is_masked).
Sourcepub fn from_editor_with_paste(
state: &EditorState,
masked: bool,
can_paste: bool,
) -> Self
pub fn from_editor_with_paste( state: &EditorState, masked: bool, can_paste: bool, ) -> Self
Igual que Self::from_editor pero fijando can_paste
explícitamente (cuando el caller ya sabe si el clipboard tiene
algo, p.ej. consultándolo una vez por frame).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EditFlags
impl RefUnwindSafe for EditFlags
impl Send for EditFlags
impl Sync for EditFlags
impl Unpin for EditFlags
impl UnsafeUnpin for EditFlags
impl UnwindSafe for EditFlags
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.