revert timeline no_scroll stuff
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -55,23 +55,6 @@ impl<'a> TimelineView<'a> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ui_no_scroll(&mut self, ui: &mut egui::Ui) -> TimelineResponse {
|
|
||||||
if let Some(timeline) = self.columns.find_timeline_mut(self.timeline_id) {
|
|
||||||
timeline.selected_view = tabs_ui(ui);
|
|
||||||
};
|
|
||||||
|
|
||||||
timeline_ui_no_scroll(
|
|
||||||
ui,
|
|
||||||
self.ndb,
|
|
||||||
self.timeline_id,
|
|
||||||
self.columns,
|
|
||||||
self.note_cache,
|
|
||||||
self.img_cache,
|
|
||||||
self.reverse,
|
|
||||||
self.textmode,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn reversed(mut self) -> Self {
|
pub fn reversed(mut self) -> Self {
|
||||||
self.reverse = true;
|
self.reverse = true;
|
||||||
self
|
self
|
||||||
@@ -120,53 +103,30 @@ fn timeline_ui(
|
|||||||
.auto_shrink([false, false])
|
.auto_shrink([false, false])
|
||||||
.scroll_bar_visibility(ScrollBarVisibility::AlwaysVisible)
|
.scroll_bar_visibility(ScrollBarVisibility::AlwaysVisible)
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
timeline_ui_no_scroll(
|
let timeline = if let Some(timeline) = columns.find_timeline_mut(timeline_id) {
|
||||||
ui,
|
timeline
|
||||||
ndb,
|
} else {
|
||||||
timeline_id,
|
error!("tried to render timeline in column, but timeline was missing");
|
||||||
columns,
|
// TODO (jb55): render error when timeline is missing?
|
||||||
note_cache,
|
// this shouldn't happen...
|
||||||
img_cache,
|
return TimelineResponse::default();
|
||||||
|
};
|
||||||
|
|
||||||
|
let txn = Transaction::new(ndb).expect("failed to create txn");
|
||||||
|
TimelineTabView::new(
|
||||||
|
timeline.current_view(),
|
||||||
reversed,
|
reversed,
|
||||||
textmode,
|
textmode,
|
||||||
|
&txn,
|
||||||
|
ndb,
|
||||||
|
note_cache,
|
||||||
|
img_cache,
|
||||||
)
|
)
|
||||||
|
.show(ui)
|
||||||
})
|
})
|
||||||
.inner
|
.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
|
||||||
fn timeline_ui_no_scroll(
|
|
||||||
ui: &mut egui::Ui,
|
|
||||||
ndb: &Ndb,
|
|
||||||
timeline_id: TimelineId,
|
|
||||||
columns: &mut Columns,
|
|
||||||
note_cache: &mut NoteCache,
|
|
||||||
img_cache: &mut ImageCache,
|
|
||||||
reversed: bool,
|
|
||||||
textmode: bool,
|
|
||||||
) -> TimelineResponse {
|
|
||||||
let timeline = if let Some(timeline) = columns.find_timeline_mut(timeline_id) {
|
|
||||||
timeline
|
|
||||||
} else {
|
|
||||||
error!("tried to render timeline in column, but timeline was missing");
|
|
||||||
// TODO (jb55): render error when timeline is missing?
|
|
||||||
// this shouldn't happen...
|
|
||||||
return TimelineResponse::default();
|
|
||||||
};
|
|
||||||
|
|
||||||
let txn = Transaction::new(ndb).expect("failed to create txn");
|
|
||||||
TimelineTabView::new(
|
|
||||||
timeline.current_view(),
|
|
||||||
reversed,
|
|
||||||
textmode,
|
|
||||||
&txn,
|
|
||||||
ndb,
|
|
||||||
note_cache,
|
|
||||||
img_cache,
|
|
||||||
)
|
|
||||||
.show(ui)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn tabs_ui(ui: &mut egui::Ui) -> i32 {
|
pub fn tabs_ui(ui: &mut egui::Ui) -> i32 {
|
||||||
ui.spacing_mut().item_spacing.y = 0.0;
|
ui.spacing_mut().item_spacing.y = 0.0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user