timelineview: add customizable initial note capacity
We will be using this for threads, so we'll want a smaller capacity there. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -70,11 +70,15 @@ pub struct TimelineView {
|
|||||||
|
|
||||||
impl TimelineView {
|
impl TimelineView {
|
||||||
pub fn new(filter: ViewFilter) -> Self {
|
pub fn new(filter: ViewFilter) -> Self {
|
||||||
|
TimelineView::new_with_capacity(filter, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_with_capacity(filter: ViewFilter, cap: usize) -> Self {
|
||||||
let selection = 0i32;
|
let selection = 0i32;
|
||||||
let mut list = VirtualList::new();
|
let mut list = VirtualList::new();
|
||||||
list.hide_on_resize(None);
|
list.hide_on_resize(None);
|
||||||
let list = Rc::new(RefCell::new(list));
|
let list = Rc::new(RefCell::new(list));
|
||||||
let notes: Vec<NoteRef> = Vec::with_capacity(1000);
|
let notes: Vec<NoteRef> = Vec::with_capacity(cap);
|
||||||
|
|
||||||
TimelineView {
|
TimelineView {
|
||||||
notes,
|
notes,
|
||||||
|
|||||||
Reference in New Issue
Block a user