struct Lightbox {Show 22 fields
ui: Rc<LibraryWindowUi>,
header: LightboxHeader,
picture: PictureArea,
unavailable: UnavailableCard,
video_badge_button: Button,
actions: ActionBar,
details: DetailsPane,
viewer: Box,
pos: Cell<u32>,
load_gen: Cell<u64>,
active_a: Cell<bool>,
zoom_level: Cell<f64>,
nav_dir: Cell<i8>,
cursor_pos: Cell<Option<(f64, f64)>>,
drag_start: Cell<(f64, f64)>,
pinch_start: Cell<f64>,
unavailable_path: RefCell<Option<String>>,
video: RefCell<Option<Rc<VideoPlayer>>>,
fullscreen_handler: RefCell<Option<SignalHandlerId>>,
drag_path: RefCell<Option<PathBuf>>,
reload_on_close: Cell<bool>,
chrome: Chrome,
}Expand description
Lightbox page widgets plus the state shared by its signal handlers.
Handlers hold strong Rcs, so it lives as long as the page’s widgets.
Fields§
§ui: Rc<LibraryWindowUi>§header: LightboxHeader§picture: PictureArea§actions: ActionBar§details: DetailsPane§viewer: Box§pos: Cell<u32>§load_gen: Cell<u64>§active_a: Cell<bool>§zoom_level: Cell<f64>§cursor_pos: Cell<Option<(f64, f64)>>§drag_start: Cell<(f64, f64)>§pinch_start: Cell<f64>§video: RefCell<Option<Rc<VideoPlayer>>>§fullscreen_handler: RefCell<Option<SignalHandlerId>>§drag_path: RefCell<Option<PathBuf>>§reload_on_close: Cell<bool>§chrome: ChromeImplementations§
Source§impl Lightbox
impl Lightbox
pub(super) fn connect_fullscreen(self: &Rc<Self>)
pub(super) fn toggle_fullscreen(&self)
pub(super) fn close_fullscreen(&self)
fn apply_fullscreen(&self, fullscreen: bool)
fn connect_chrome_reveal(self: &Rc<Self>)
fn reveal_chrome(self: &Rc<Self>)
fn arm_chrome_hide(self: &Rc<Self>, delay: Duration)
Source§impl Lightbox
impl Lightbox
Sourcepub(super) fn load_ocr(self: &Rc<Self>, asset_id: String, image: (f64, f64))
pub(super) fn load_ocr(self: &Rc<Self>, asset_id: String, image: (f64, f64))
Fetches the photo’s OCR boxes; results for a photo the user has left are dropped.
Sourcepub(super) fn connect_ocr(self: &Rc<Self>)
pub(super) fn connect_ocr(self: &Rc<Self>)
All OCR input goes through the picture scroller, since the drawing layer can’t take input.
fn connect_ocr_toggle(self: &Rc<Self>)
Sourcepub(super) fn handle_ocr_key(self: &Rc<Self>, key: Key, ctrl: bool) -> bool
pub(super) fn handle_ocr_key(self: &Rc<Self>, key: Key, ctrl: bool) -> bool
T, Ctrl+A and Ctrl+C; returns whether the key was handled.
Sourcefn connect_ocr_mouse_selection(self: &Rc<Self>)
fn connect_ocr_mouse_selection(self: &Rc<Self>)
Mouse presses on a box select text instead of panning, swiping or dragging the photo out.
Sourcefn connect_ocr_taps(self: &Rc<Self>)
fn connect_ocr_taps(self: &Rc<Self>)
Touch taps toggle boxes; drags are left to panning, pinching and swiping.
Sourcefn connect_ocr_hover(self: &Rc<Self>)
fn connect_ocr_hover(self: &Rc<Self>)
Text cursor and highlight over a box, with its text as a tooltip.
fn set_ocr_hover(&self, idx: Option<usize>)
Sourcepub(super) fn copy_ocr_text(self: &Rc<Self>)
pub(super) fn copy_ocr_text(self: &Rc<Self>)
Copies the selection, or all text when nothing is selected.
Sourcepub(super) fn ocr_box_under(&self, x: f64, y: f64) -> Option<usize>
pub(super) fn ocr_box_under(&self, x: f64, y: f64) -> Option<usize>
Box under a point in picture-scroller coordinates, while the text is shown.
Sourcepub(super) fn sync_ocr_controls(&self)
pub(super) fn sync_ocr_controls(&self)
Shows the toggle, layer and copy button to match the current photo’s boxes.
Source§impl Lightbox
impl Lightbox
fn video_player(self: &Rc<Self>) -> Result<Rc<VideoPlayer>, String>
fn video_hooks(self: &Rc<Self>) -> VideoHooks
pub(super) fn prepare_video(self: &Rc<Self>, is_video: bool)
pub(super) fn toggle_video(self: &Rc<Self>)
fn load_video(self: &Rc<Self>)
async fn video_source(&self, info: &AssetInfo) -> Result<VideoSource, String>
pub(super) fn handle_video_key(self: &Rc<Self>, key: Key) -> bool
pub(super) fn close_video(&self)
pub(super) fn open_current_with(&self)
Source§impl Lightbox
impl Lightbox
Sourcefn new(
ui: Rc<LibraryWindowUi>,
position: u32,
initial_filename: &str,
) -> Rc<Self>
fn new( ui: Rc<LibraryWindowUi>, position: u32, initial_filename: &str, ) -> Rc<Self>
Build the page’s widget tree; signal handlers are connected by the connect_* methods.
Sourcefn connect_overlays(self: &Rc<Self>)
fn connect_overlays(self: &Rc<Self>)
Wire the external-open button, the video play badge, and the drag-out source.
Prev/next buttons, hidden on narrow layouts.
Sourcefn connect_zoom_controls(self: &Rc<Self>)
fn connect_zoom_controls(self: &Rc<Self>)
Zoom buttons, pinch, drag-to-pan, double/middle click, and Ctrl+scroll.
Sourcefn connect_pan_and_pinch(self: &Rc<Self>)
fn connect_pan_and_pinch(self: &Rc<Self>)
Pinch-to-zoom and click-and-drag panning, grouped so they don’t fight over touches.
Sourcefn connect_pointer_gestures(self: &Rc<Self>)
fn connect_pointer_gestures(self: &Rc<Self>)
Cursor tracking for focal zoom, the right-click menu, and swipe navigation.
Sourcefn connect_keys(self: &Rc<Self>)
fn connect_keys(self: &Rc<Self>)
Ctrl +/-/0 zoom, Left/Right navigate, I toggles details, Escape closes.
Sourcefn connect_actions(self: &Rc<Self>)
fn connect_actions(self: &Rc<Self>)
Download button and the preview/original resolution toggle.
Sourcefn search_tag(&self, tag: Tag)
fn search_tag(&self, tag: Tag)
Close the lightbox and show every photo carrying tag.
fn current_item(&self) -> Option<AssetObject>
Hooks for the right-click menu so trash/edit there update this lightbox.
Sourcefn confirm_trash_current(self: &Rc<Self>)
fn confirm_trash_current(self: &Rc<Self>)
Delete key / trash button: move to trash, or delete permanently in the Trash view.
Sourcefn after_trash(self: &Rc<Self>)
fn after_trash(self: &Rc<Self>)
The trashed item is already gone from the grid model, so the same index now holds the next photo; step back at the end and close once nothing is left.
fn edit_current(self: &Rc<Self>)
Sourcefn toggle_current_favorite(self: &Rc<Self>)
fn toggle_current_favorite(self: &Rc<Self>)
Heart button / F key. Un-favoriting inside the Favorites view drops the photo from the grid, so the lightbox then moves on as it does after a trash.
fn show_heart(&self, favorite: bool)
fn toggle_current_archive(self: &Rc<Self>)
fn show_archive(&self, archived: bool)
fn after_edit(self: &Rc<Self>, date_changed: bool)
fn handle_swipe(self: &Rc<Self>, vx: f64)
fn handle_key(self: &Rc<Self>, key: Key, mods: ModifierType) -> Propagation
Sourcefn handle_zoom_scroll(
&self,
ctrl: &EventControllerScroll,
dx: f64,
dy: f64,
) -> Propagation
fn handle_zoom_scroll( &self, ctrl: &EventControllerScroll, dx: f64, dy: f64, ) -> Propagation
Zoom on Ctrl+scroll; plain scrolling falls through to panning.
fn goto_prev(self: &Rc<Self>)
Sourcefn advance_when_page_loads(self: &Rc<Self>)
fn advance_when_page_loads(self: &Rc<Self>)
Advance once the next page lands in the grid model, then drop the handler.
fn active_picture(&self) -> Picture
fn zoom_by(&self, factor: f64)
fn zoom_reset(&self)
Sourcefn set_zoom(&self, z: f64)
fn set_zoom(&self, z: f64)
Zoom to z (clamped to 1–10×), keeping the focal point under the cursor.
Sourcefn show_summary(&self, info: &AssetInfo)
fn show_summary(&self, info: &AssetInfo)
Filename and sync summary; clears the previous asset’s EXIF rows.
Sourcefn start_picture_load(self: &Rc<Self>, info: &AssetInfo)
fn start_picture_load(self: &Rc<Self>, info: &AssetInfo)
Load into the inactive picture and commit the slide transition only after the texture is set, so the user keeps seeing the current image (with the loader spinner) until the new one is actually ready.
Sourcefn load_into_picture(self: &Rc<Self>, load: PictureLoad)
fn load_into_picture(self: &Rc<Self>, load: PictureLoad)
Reset overlays, show any cached thumbnail, then load the real picture asynchronously.
Sourcefn prepare_for_load(&self, load: &PictureLoad)
fn prepare_for_load(&self, load: &PictureLoad)
Clear the previous asset’s overlays and drag path, set up the video badge, and show the cached grid thumbnail until the real picture arrives.
Sourcefn arm_loader_spinner(&self, delay_ms: u64) -> Rc<Cell<bool>>
fn arm_loader_spinner(&self, delay_ms: u64) -> Rc<Cell<bool>>
Reveal the spinner after delay_ms unless the returned flag is set first.
Sourceasync fn fetch_picture(&self, load: &PictureLoad) -> LoadResult
async fn fetch_picture(&self, load: &PictureLoad) -> LoadResult
Pick the source: video poster, local file, original download, or preview thumbnail. Edited assets use Immich’s edited render and fall back to the local file.
async fn load_preview_thumbnail( &self, asset_id: &str, edited: bool, ) -> Result<Texture, String>
Sourceasync fn fetch_original(&self, load: &PictureLoad) -> LoadResult
async fn fetch_original(&self, load: &PictureLoad) -> LoadResult
Original file from the preview cache, downloaded on a miss.
Sourceasync fn download_original(
&self,
asset_id: &str,
temp: &Path,
edited: bool,
) -> Result<(), String>
async fn download_original( &self, asset_id: &str, temp: &Path, edited: bool, ) -> Result<(), String>
Download an original, registered with the download progress tracker.
Sourcefn show_load_result(self: &Rc<Self>, load: &PictureLoad, result: LoadResult)
fn show_load_result(self: &Rc<Self>, load: &PictureLoad, result: LoadResult)
Apply a load result, then slide to the target picture.
Sourcefn load_local_details(self: &Rc<Self>, pos: u32, local_path: String)
fn load_local_details(self: &Rc<Self>, pos: u32, local_path: String)
Local image: parse EXIF on a blocking worker (cached on disk, so repeat opens are cheap).
Sourcefn load_remote_details(self: &Rc<Self>, pos: u32, asset_id: String)
fn load_remote_details(self: &Rc<Self>, pos: u32, asset_id: String)
Fetch EXIF from the server; dropped if the user has moved to another asset.
Auto Trait Implementations§
impl !Freeze for Lightbox
impl !RefUnwindSafe for Lightbox
impl !Send for Lightbox
impl !Sync for Lightbox
impl !UnwindSafe for Lightbox
impl Unpin for Lightbox
impl UnsafeUnpin for Lightbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more