mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
add ellpsis support to textview
This commit is contained in:
parent
8b85d52587
commit
a4a96c9c56
2 changed files with 5 additions and 0 deletions
|
|
@ -68,6 +68,7 @@ pub struct TextView {
|
||||||
pub text: xous::String::<3072>,
|
pub text: xous::String::<3072>,
|
||||||
pub cursor: Cursor,
|
pub cursor: Cursor,
|
||||||
pub insertion: Option<u32>, // this is the insertion point offset, if it's to be drawn, on the string
|
pub insertion: Option<u32>, // this is the insertion point offset, if it's to be drawn, on the string
|
||||||
|
pub ellipsis: bool,
|
||||||
|
|
||||||
pub draw_border: bool,
|
pub draw_border: bool,
|
||||||
pub clear_area: bool, // you almost always want this to be true
|
pub clear_area: bool, // you almost always want this to be true
|
||||||
|
|
@ -96,6 +97,7 @@ impl TextView {
|
||||||
text: xous::String::<3072>::new(),
|
text: xous::String::<3072>::new(),
|
||||||
cursor: Cursor::new(0,0,0),
|
cursor: Cursor::new(0,0,0),
|
||||||
insertion: None,
|
insertion: None,
|
||||||
|
ellipsis: false,
|
||||||
draw_border: true,
|
draw_border: true,
|
||||||
border_width: 1,
|
border_width: 1,
|
||||||
rounded_border: None,
|
rounded_border: None,
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ fn xmain() -> ! {
|
||||||
s.as_str().unwrap(),
|
s.as_str().unwrap(),
|
||||||
false,
|
false,
|
||||||
None,
|
None,
|
||||||
|
false,
|
||||||
blitstr::xor_char
|
blitstr::xor_char
|
||||||
);
|
);
|
||||||
//info!("GFX: string painted");
|
//info!("GFX: string painted");
|
||||||
|
|
@ -130,6 +131,7 @@ fn xmain() -> ! {
|
||||||
s.as_str().unwrap(),
|
s.as_str().unwrap(),
|
||||||
true,
|
true,
|
||||||
None,
|
None,
|
||||||
|
false,
|
||||||
blitstr::xor_char
|
blitstr::xor_char
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
@ -246,6 +248,7 @@ fn xmain() -> ! {
|
||||||
tv.text.as_str().unwrap(),
|
tv.text.as_str().unwrap(),
|
||||||
false,
|
false,
|
||||||
tv.insertion,
|
tv.insertion,
|
||||||
|
tv.ellipsis,
|
||||||
paintfn
|
paintfn
|
||||||
);
|
);
|
||||||
// translate the cursor return value back to canvas coordinates
|
// translate the cursor return value back to canvas coordinates
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue