rename ImageCache -> MediaCache
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use core::f32;
|
||||
|
||||
use egui::{vec2, Button, Layout, Margin, RichText, Rounding, ScrollArea, TextEdit};
|
||||
use notedeck::{ImageCache, NotedeckTextStyle};
|
||||
use notedeck::{MediaCache, NotedeckTextStyle};
|
||||
|
||||
use crate::{colors, profile_state::ProfileState};
|
||||
|
||||
@@ -9,11 +9,11 @@ use super::{banner, unwrap_profile_url, ProfilePic};
|
||||
|
||||
pub struct EditProfileView<'a> {
|
||||
state: &'a mut ProfileState,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
}
|
||||
|
||||
impl<'a> EditProfileView<'a> {
|
||||
pub fn new(state: &'a mut ProfileState, img_cache: &'a mut ImageCache) -> Self {
|
||||
pub fn new(state: &'a mut ProfileState, img_cache: &'a mut MediaCache) -> Self {
|
||||
Self { state, img_cache }
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
NostrName,
|
||||
};
|
||||
|
||||
use notedeck::{Accounts, ImageCache, MuteFun, NoteCache, NotedeckTextStyle, UnknownIds};
|
||||
use notedeck::{Accounts, MediaCache, MuteFun, NoteCache, NotedeckTextStyle, UnknownIds};
|
||||
|
||||
pub struct ProfileView<'a> {
|
||||
pubkey: &'a Pubkey,
|
||||
@@ -33,7 +33,7 @@ pub struct ProfileView<'a> {
|
||||
note_options: NoteOptions,
|
||||
ndb: &'a Ndb,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
unknown_ids: &'a mut UnknownIds,
|
||||
is_muted: &'a MuteFun,
|
||||
}
|
||||
@@ -52,7 +52,7 @@ impl<'a> ProfileView<'a> {
|
||||
timeline_cache: &'a mut TimelineCache,
|
||||
ndb: &'a Ndb,
|
||||
note_cache: &'a mut NoteCache,
|
||||
img_cache: &'a mut ImageCache,
|
||||
img_cache: &'a mut MediaCache,
|
||||
unknown_ids: &'a mut UnknownIds,
|
||||
is_muted: &'a MuteFun,
|
||||
note_options: NoteOptions,
|
||||
|
||||
@@ -4,10 +4,10 @@ use egui::{vec2, Sense, Stroke, TextureHandle};
|
||||
use nostrdb::{Ndb, Transaction};
|
||||
use tracing::info;
|
||||
|
||||
use notedeck::{AppContext, ImageCache};
|
||||
use notedeck::{AppContext, MediaCache};
|
||||
|
||||
pub struct ProfilePic<'cache, 'url> {
|
||||
cache: &'cache mut ImageCache,
|
||||
cache: &'cache mut MediaCache,
|
||||
url: &'url str,
|
||||
size: f32,
|
||||
border: Option<Stroke>,
|
||||
@@ -20,7 +20,7 @@ impl egui::Widget for ProfilePic<'_, '_> {
|
||||
}
|
||||
|
||||
impl<'cache, 'url> ProfilePic<'cache, 'url> {
|
||||
pub fn new(cache: &'cache mut ImageCache, url: &'url str) -> Self {
|
||||
pub fn new(cache: &'cache mut MediaCache, url: &'url str) -> Self {
|
||||
let size = Self::default_size();
|
||||
ProfilePic {
|
||||
cache,
|
||||
@@ -35,7 +35,7 @@ impl<'cache, 'url> ProfilePic<'cache, 'url> {
|
||||
}
|
||||
|
||||
pub fn from_profile(
|
||||
cache: &'cache mut ImageCache,
|
||||
cache: &'cache mut MediaCache,
|
||||
profile: &nostrdb::ProfileRecord<'url>,
|
||||
) -> Option<Self> {
|
||||
profile
|
||||
@@ -80,7 +80,7 @@ impl<'cache, 'url> ProfilePic<'cache, 'url> {
|
||||
|
||||
fn render_pfp(
|
||||
ui: &mut egui::Ui,
|
||||
img_cache: &mut ImageCache,
|
||||
img_cache: &mut MediaCache,
|
||||
url: &str,
|
||||
ui_size: f32,
|
||||
border: Option<Stroke>,
|
||||
|
||||
@@ -4,18 +4,18 @@ use egui::{Frame, Label, RichText, Widget};
|
||||
use egui_extras::Size;
|
||||
use nostrdb::ProfileRecord;
|
||||
|
||||
use notedeck::{ImageCache, NotedeckTextStyle, UserAccount};
|
||||
use notedeck::{MediaCache, NotedeckTextStyle, UserAccount};
|
||||
|
||||
use super::{about_section_widget, banner, display_name_widget, get_display_name, get_profile_url};
|
||||
|
||||
pub struct ProfilePreview<'a, 'cache> {
|
||||
profile: &'a ProfileRecord<'a>,
|
||||
cache: &'cache mut ImageCache,
|
||||
cache: &'cache mut MediaCache,
|
||||
banner_height: Size,
|
||||
}
|
||||
|
||||
impl<'a, 'cache> ProfilePreview<'a, 'cache> {
|
||||
pub fn new(profile: &'a ProfileRecord<'a>, cache: &'cache mut ImageCache) -> Self {
|
||||
pub fn new(profile: &'a ProfileRecord<'a>, cache: &'cache mut MediaCache) -> Self {
|
||||
let banner_height = Size::exact(80.0);
|
||||
ProfilePreview {
|
||||
profile,
|
||||
@@ -69,14 +69,14 @@ impl egui::Widget for ProfilePreview<'_, '_> {
|
||||
|
||||
pub struct SimpleProfilePreview<'a, 'cache> {
|
||||
profile: Option<&'a ProfileRecord<'a>>,
|
||||
cache: &'cache mut ImageCache,
|
||||
cache: &'cache mut MediaCache,
|
||||
is_nsec: bool,
|
||||
}
|
||||
|
||||
impl<'a, 'cache> SimpleProfilePreview<'a, 'cache> {
|
||||
pub fn new(
|
||||
profile: Option<&'a ProfileRecord<'a>>,
|
||||
cache: &'cache mut ImageCache,
|
||||
cache: &'cache mut MediaCache,
|
||||
is_nsec: bool,
|
||||
) -> Self {
|
||||
SimpleProfilePreview {
|
||||
|
||||
Reference in New Issue
Block a user