Fullscreen MediaViewer refactor
- Moved media related logic into notedeck instead of the ui crate, since they pertain to Images/ImageCache based systems - Made RenderableMedia owned to make it less of a nightmware to work with and the perf should be negligible - Added a ImageMetadata cache to Images. This is referenced whenever we encounter an image so we don't have to redo the work all of the time - Relpaced our ad-hoc, hand(vibe?)-coded panning and zoom logic with the Scene widget, which is explicitly designed for this use case - Extracted and detangle fullscreen media rendering from inside of note rendering. We instead let the application decide what action they want to perform when note media is clicked on. - We add an on_view_media action to MediaAction for the application to handle. The Columns app uses this toggle a FullscreenMedia app option bits whenever we get a MediaAction::ViewMedis(urls). Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -8,8 +8,7 @@ use egui_wgpu::RenderState;
|
||||
use enostr::KeypairUnowned;
|
||||
use futures::StreamExt;
|
||||
use nostrdb::Transaction;
|
||||
use notedeck::{AppAction, AppContext};
|
||||
use notedeck_ui::jobs::JobsCache;
|
||||
use notedeck::{AppAction, AppContext, JobsCache};
|
||||
use std::collections::HashMap;
|
||||
use std::string::ToString;
|
||||
use std::sync::mpsc::{self, Receiver};
|
||||
|
||||
@@ -4,8 +4,10 @@ use crate::{
|
||||
};
|
||||
use egui::{Align, Key, KeyboardShortcut, Layout, Modifiers};
|
||||
use nostrdb::{Ndb, Transaction};
|
||||
use notedeck::{tr, Accounts, AppContext, Images, Localization, NoteAction, NoteContext};
|
||||
use notedeck_ui::{app_images, icons::search_icon, jobs::JobsCache, NoteOptions, ProfilePic};
|
||||
use notedeck::{
|
||||
tr, Accounts, AppContext, Images, JobsCache, Localization, NoteAction, NoteContext,
|
||||
};
|
||||
use notedeck_ui::{app_images, icons::search_icon, NoteOptions, ProfilePic};
|
||||
|
||||
/// DaveUi holds all of the data it needs to render itself
|
||||
pub struct DaveUi<'a> {
|
||||
|
||||
Reference in New Issue
Block a user