forked from kent/consciousness
subconscious: use ScrollPane for history pane
Replace bare history_scroll: u16 with ScrollPaneState. The history pane now uses ScrollPane for rendering, getting proper height caching and scrollbar for free. Also relax ScrollItem lifetime bounds from 'static to 'a so non-static Lines (built on the fly during render) can be used. Co-Authored-By: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
2230fdf3c1
commit
d18bf6243a
2 changed files with 14 additions and 12 deletions
|
|
@ -22,19 +22,19 @@ pub trait ScrollItem {
|
|||
|
||||
// Blanket impls for common types
|
||||
|
||||
impl ScrollItem for Line<'static> {
|
||||
impl<'a> ScrollItem for Line<'a> {
|
||||
fn content(&self) -> Text<'_> {
|
||||
Text::from(self.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl ScrollItem for Vec<Line<'static>> {
|
||||
impl<'a> ScrollItem for Vec<Line<'a>> {
|
||||
fn content(&self) -> Text<'_> {
|
||||
Text::from(self.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl ScrollItem for Text<'static> {
|
||||
impl<'a> ScrollItem for Text<'a> {
|
||||
fn content(&self) -> Text<'_> {
|
||||
self.clone()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue