mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 00:54:21 +01:00
columns/timeline: include column index in timeline view_id
might fix weird scroll issues on profiles Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -247,12 +247,12 @@ impl Timeline {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn make_view_id(id: &TimelineKind, selected_view: usize) -> egui::Id {
|
||||
egui::Id::new((id, selected_view))
|
||||
pub fn make_view_id(id: &TimelineKind, col: usize, selected_view: usize) -> egui::Id {
|
||||
egui::Id::new((id, selected_view, col))
|
||||
}
|
||||
|
||||
pub fn view_id(&self) -> egui::Id {
|
||||
Timeline::make_view_id(&self.kind, self.selected_view)
|
||||
pub fn view_id(&self, col: usize) -> egui::Id {
|
||||
Timeline::make_view_id(&self.kind, col, self.selected_view)
|
||||
}
|
||||
|
||||
pub fn new(kind: TimelineKind, filter_state: FilterState, views: Vec<TimelineTab>) -> Self {
|
||||
|
||||
@@ -37,6 +37,7 @@ pub fn render_timeline_route(
|
||||
note_options,
|
||||
&(&accounts.get_selected_account().key).into(),
|
||||
jobs,
|
||||
col,
|
||||
)
|
||||
.ui(ui);
|
||||
|
||||
@@ -66,6 +67,7 @@ pub fn render_timeline_route(
|
||||
note_options,
|
||||
&(&accounts.get_selected_account().key).into(),
|
||||
jobs,
|
||||
col,
|
||||
)
|
||||
.ui(ui);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ pub struct TimelineView<'a, 'd> {
|
||||
note_context: &'a mut NoteContext<'d>,
|
||||
cur_acc: &'a KeypairUnowned<'a>,
|
||||
jobs: &'a mut JobsCache,
|
||||
col: usize,
|
||||
}
|
||||
|
||||
impl<'a, 'd> TimelineView<'a, 'd> {
|
||||
@@ -36,6 +37,7 @@ impl<'a, 'd> TimelineView<'a, 'd> {
|
||||
note_options: NoteOptions,
|
||||
cur_acc: &'a KeypairUnowned<'a>,
|
||||
jobs: &'a mut JobsCache,
|
||||
col: usize,
|
||||
) -> Self {
|
||||
let reverse = false;
|
||||
TimelineView {
|
||||
@@ -47,6 +49,7 @@ impl<'a, 'd> TimelineView<'a, 'd> {
|
||||
note_context,
|
||||
cur_acc,
|
||||
jobs,
|
||||
col,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +64,7 @@ impl<'a, 'd> TimelineView<'a, 'd> {
|
||||
self.note_context,
|
||||
self.cur_acc,
|
||||
self.jobs,
|
||||
self.col,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -81,6 +85,7 @@ fn timeline_ui(
|
||||
note_context: &mut NoteContext,
|
||||
cur_acc: &KeypairUnowned,
|
||||
jobs: &mut JobsCache,
|
||||
col: usize,
|
||||
) -> Option<NoteAction> {
|
||||
//padding(4.0, ui, |ui| ui.heading("Notifications"));
|
||||
/*
|
||||
@@ -104,7 +109,7 @@ fn timeline_ui(
|
||||
// need this for some reason??
|
||||
ui.add_space(3.0);
|
||||
|
||||
egui::Id::new(("tlscroll", timeline.view_id()))
|
||||
egui::Id::new(("tlscroll", timeline.view_id(col)))
|
||||
};
|
||||
|
||||
let show_top_button_id = ui.id().with((scroll_id, "at_top"));
|
||||
|
||||
Reference in New Issue
Block a user