mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
gam: add dirty bool to TextEntryPayloads
Useful to filter out unused entries.
This commit is contained in:
parent
ec9fdb0e42
commit
c702025283
1 changed files with 4 additions and 4 deletions
|
|
@ -72,7 +72,7 @@ impl ItemName {
|
||||||
|
|
||||||
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone, Eq, PartialEq, Default)]
|
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone, Eq, PartialEq, Default)]
|
||||||
pub struct TextEntryPayload {
|
pub struct TextEntryPayload {
|
||||||
pub id: u32,
|
dirty: bool,
|
||||||
pub content: String::<256>,
|
pub content: String::<256>,
|
||||||
pub placeholder: Option<String::<256>>,
|
pub placeholder: Option<String::<256>>,
|
||||||
}
|
}
|
||||||
|
|
@ -80,14 +80,14 @@ pub struct TextEntryPayload {
|
||||||
impl TextEntryPayload {
|
impl TextEntryPayload {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
TextEntryPayload{
|
TextEntryPayload{
|
||||||
id: Default::default(),
|
dirty: Default::default(),
|
||||||
content: Default::default(),
|
content: Default::default(),
|
||||||
placeholder: Default::default(),
|
placeholder: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_with_fields(id: u32, content: String::<256>, placeholder: Option<String::<256>>) -> Self {
|
pub fn new_with_fields(content: String::<256>, placeholder: Option<String::<256>>) -> Self {
|
||||||
TextEntryPayload { id: id, content: content, placeholder: placeholder }
|
TextEntryPayload { dirty: false, content: content, placeholder: placeholder }
|
||||||
}
|
}
|
||||||
/// Ensures that 0's are written to the storage of this struct, and not optimized out; important for password fields.
|
/// Ensures that 0's are written to the storage of this struct, and not optimized out; important for password fields.
|
||||||
pub fn volatile_clear(&mut self) {
|
pub fn volatile_clear(&mut self) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue