migrate to using Images instead of MediaCache directly

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-02-18 19:42:17 -05:00
parent 75a352a86f
commit 33fdf647e3
27 changed files with 101 additions and 106 deletions

View File

@@ -12,7 +12,7 @@ use egui::{vec2, Direction, Layout, Pos2, Stroke};
use egui_tabs::TabColor;
use nostrdb::{Ndb, Transaction};
use notedeck::note::root_note_id_from_selected_id;
use notedeck::{MediaCache, MuteFun, NoteCache};
use notedeck::{Images, MuteFun, NoteCache};
use tracing::{error, warn};
use super::anim::{AnimationHelper, ICON_EXPANSION_MULTIPLE};
@@ -22,19 +22,20 @@ pub struct TimelineView<'a> {
timeline_cache: &'a mut TimelineCache,
ndb: &'a Ndb,
note_cache: &'a mut NoteCache,
img_cache: &'a mut MediaCache,
img_cache: &'a mut Images,
note_options: NoteOptions,
reverse: bool,
is_muted: &'a MuteFun,
}
impl<'a> TimelineView<'a> {
#[allow(clippy::too_many_arguments)]
pub fn new(
timeline_id: &'a TimelineKind,
timeline_cache: &'a mut TimelineCache,
ndb: &'a Ndb,
note_cache: &'a mut NoteCache,
img_cache: &'a mut MediaCache,
img_cache: &'a mut Images,
note_options: NoteOptions,
is_muted: &'a MuteFun,
) -> TimelineView<'a> {
@@ -78,7 +79,7 @@ fn timeline_ui(
timeline_id: &TimelineKind,
timeline_cache: &mut TimelineCache,
note_cache: &mut NoteCache,
img_cache: &mut MediaCache,
img_cache: &mut Images,
reversed: bool,
note_options: NoteOptions,
is_muted: &MuteFun,
@@ -321,7 +322,7 @@ pub struct TimelineTabView<'a> {
txn: &'a Transaction,
ndb: &'a Ndb,
note_cache: &'a mut NoteCache,
img_cache: &'a mut MediaCache,
img_cache: &'a mut Images,
is_muted: &'a MuteFun,
}
@@ -334,7 +335,7 @@ impl<'a> TimelineTabView<'a> {
txn: &'a Transaction,
ndb: &'a Ndb,
note_cache: &'a mut NoteCache,
img_cache: &'a mut MediaCache,
img_cache: &'a mut Images,
is_muted: &'a MuteFun,
) -> Self {
Self {