mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
add option to defer draw updates
this is helpful for composited UIs
This commit is contained in:
parent
27e5f0b72f
commit
765a36bd3a
1 changed files with 7 additions and 1 deletions
|
|
@ -60,6 +60,7 @@ pub struct ScrollableList {
|
||||||
/// for some global shared state to lock the UI for a given model which I haven't
|
/// for some global shared state to lock the UI for a given model which I haven't
|
||||||
/// figured out how to handle any other way.
|
/// figured out how to handle any other way.
|
||||||
pub gfx: Gfx,
|
pub gfx: Gfx,
|
||||||
|
autoflush: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Clone for ScrollableList {
|
impl Clone for ScrollableList {
|
||||||
|
|
@ -104,9 +105,12 @@ impl ScrollableList {
|
||||||
text_alignment: TextAlignment::Left,
|
text_alignment: TextAlignment::Left,
|
||||||
pane: RefCell::new(pane),
|
pane: RefCell::new(pane),
|
||||||
gfx,
|
gfx,
|
||||||
|
autoflush: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_autoflush(&mut self, autoflush: bool) { self.autoflush = autoflush; }
|
||||||
|
|
||||||
pub fn get_alignment(&self) -> TextAlignment { self.text_alignment }
|
pub fn get_alignment(&self) -> TextAlignment { self.text_alignment }
|
||||||
|
|
||||||
pub fn set_alignment<'a>(&'a mut self, alignment: TextAlignment) -> &'a mut Self {
|
pub fn set_alignment<'a>(&'a mut self, alignment: TextAlignment) -> &'a mut Self {
|
||||||
|
|
@ -507,8 +511,10 @@ impl ScrollableList {
|
||||||
self.gfx.draw_object_list(ol).unwrap();
|
self.gfx.draw_object_list(ol).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if self.autoflush {
|
||||||
self.gfx.flush().unwrap();
|
self.gfx.flush().unwrap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Update the scrollable list state based on a key action. Passes on
|
/// Update the scrollable list state based on a key action. Passes on
|
||||||
/// any unknown key actions.
|
/// any unknown key actions.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue