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

@@ -1,6 +1,6 @@
use egui::{vec2, FontId, Pos2, Rect, ScrollArea, Vec2b};
use nostrdb::{Ndb, ProfileRecord, Transaction};
use notedeck::{fonts::get_font_size, MediaCache, NotedeckTextStyle};
use notedeck::{fonts::get_font_size, Images, NotedeckTextStyle};
use tracing::error;
use crate::{
@@ -13,13 +13,13 @@ use super::{profile::get_profile_url, ProfilePic};
pub struct SearchResultsView<'a> {
ndb: &'a Ndb,
txn: &'a Transaction,
img_cache: &'a mut MediaCache,
img_cache: &'a mut Images,
results: &'a Vec<&'a [u8; 32]>,
}
impl<'a> SearchResultsView<'a> {
pub fn new(
img_cache: &'a mut MediaCache,
img_cache: &'a mut Images,
ndb: &'a Ndb,
txn: &'a Transaction,
results: &'a Vec<&'a [u8; 32]>,
@@ -84,7 +84,7 @@ impl<'a> SearchResultsView<'a> {
fn user_result<'a>(
profile: &'a ProfileRecord<'_>,
cache: &'a mut MediaCache,
cache: &'a mut Images,
index: usize,
width: f32,
) -> impl egui::Widget + 'a {