Skip to main content

Lightbox

Struct Lightbox 

Source
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§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

Implementations§

Source§

impl Lightbox

Source

pub(super) fn connect_fullscreen(self: &Rc<Self>)

Source

pub(super) fn toggle_fullscreen(&self)

Source

pub(super) fn close_fullscreen(&self)

Source

fn apply_fullscreen(&self, fullscreen: bool)

Source

fn connect_chrome_reveal(self: &Rc<Self>)

Source

fn reveal_chrome(self: &Rc<Self>)

Source

fn arm_chrome_hide(self: &Rc<Self>, delay: Duration)

Source§

impl Lightbox

Source

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.

Source

pub(super) fn connect_ocr(self: &Rc<Self>)

All OCR input goes through the picture scroller, since the drawing layer can’t take input.

Source

fn connect_ocr_toggle(self: &Rc<Self>)

Source

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.

Source

fn connect_ocr_mouse_selection(self: &Rc<Self>)

Mouse presses on a box select text instead of panning, swiping or dragging the photo out.

Source

fn connect_ocr_taps(self: &Rc<Self>)

Touch taps toggle boxes; drags are left to panning, pinching and swiping.

Source

fn connect_ocr_hover(self: &Rc<Self>)

Text cursor and highlight over a box, with its text as a tooltip.

Source

fn set_ocr_hover(&self, idx: Option<usize>)

Source

pub(super) fn copy_ocr_text(self: &Rc<Self>)

Copies the selection, or all text when nothing is selected.

Source

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.

Source

pub(super) fn sync_ocr_controls(&self)

Shows the toggle, layer and copy button to match the current photo’s boxes.

Source§

impl Lightbox

Source

fn video_player(self: &Rc<Self>) -> Result<Rc<VideoPlayer>, String>

Source

fn video_hooks(self: &Rc<Self>) -> VideoHooks

Source

pub(super) fn prepare_video(self: &Rc<Self>, is_video: bool)

Source

pub(super) fn toggle_video(self: &Rc<Self>)

Source

fn load_video(self: &Rc<Self>)

Source

async fn video_source(&self, info: &AssetInfo) -> Result<VideoSource, String>

Source

pub(super) fn handle_video_key(self: &Rc<Self>, key: Key) -> bool

Source

pub(super) fn close_video(&self)

Source

pub(super) fn open_current_with(&self)

Source§

impl Lightbox

Source

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.

Source

fn connect_overlays(self: &Rc<Self>)

Wire the external-open button, the video play badge, and the drag-out source.

Source

fn connect_navigation(self: &Rc<Self>)

Prev/next buttons, hidden on narrow layouts.

Source

fn connect_zoom_controls(self: &Rc<Self>)

Zoom buttons, pinch, drag-to-pan, double/middle click, and Ctrl+scroll.

Source

fn connect_pan_and_pinch(self: &Rc<Self>)

Pinch-to-zoom and click-and-drag panning, grouped so they don’t fight over touches.

Source

fn connect_pointer_gestures(self: &Rc<Self>)

Cursor tracking for focal zoom, the right-click menu, and swipe navigation.

Source

fn connect_keys(self: &Rc<Self>)

Ctrl +/-/0 zoom, Left/Right navigate, I toggles details, Escape closes.

Source

fn connect_actions(self: &Rc<Self>)

Download button and the preview/original resolution toggle.

Source

fn search_tag(&self, tag: Tag)

Close the lightbox and show every photo carrying tag.

Source

fn current_item(&self) -> Option<AssetObject>

Source

fn menu_hooks(self: &Rc<Self>) -> AssetMenuHooks

Hooks for the right-click menu so trash/edit there update this lightbox.

Source

fn confirm_trash_current(self: &Rc<Self>)

Delete key / trash button: move to trash, or delete permanently in the Trash view.

Source

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.

Source

fn edit_current(self: &Rc<Self>)

Source

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.

Source

fn show_heart(&self, favorite: bool)

Source

fn toggle_current_archive(self: &Rc<Self>)

Source

fn show_archive(&self, archived: bool)

Source

fn after_edit(self: &Rc<Self>, date_changed: bool)

Source

fn handle_swipe(self: &Rc<Self>, vx: f64)

Source

fn handle_key(self: &Rc<Self>, key: Key, mods: ModifierType) -> Propagation

Source

fn handle_zoom_scroll( &self, ctrl: &EventControllerScroll, dx: f64, dy: f64, ) -> Propagation

Zoom on Ctrl+scroll; plain scrolling falls through to panning.

Source

fn goto_prev(self: &Rc<Self>)

Source

fn goto_next(self: &Rc<Self>)

Step forward, fetching the next grid page first when at the end.

Source

fn advance_when_page_loads(self: &Rc<Self>)

Advance once the next page lands in the grid model, then drop the handler.

Source

fn active_picture(&self) -> Picture

Source

fn zoom_by(&self, factor: f64)

Source

fn zoom_reset(&self)

Source

fn set_zoom(&self, z: f64)

Zoom to z (clamped to 1–10×), keeping the focal point under the cursor.

Source

fn render(self: &Rc<Self>)

Show the asset at pos: title, details, action buttons, and picture.

Source

fn show_summary(&self, info: &AssetInfo)

Filename and sync summary; clears the previous asset’s EXIF rows.

Source

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.

Source

fn load_into_picture(self: &Rc<Self>, load: PictureLoad)

Reset overlays, show any cached thumbnail, then load the real picture asynchronously.

Source

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.

Source

fn arm_loader_spinner(&self, delay_ms: u64) -> Rc<Cell<bool>>

Reveal the spinner after delay_ms unless the returned flag is set first.

Source

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.

Source

async fn load_preview_thumbnail( &self, asset_id: &str, edited: bool, ) -> Result<Texture, String>

Source

async fn fetch_original(&self, load: &PictureLoad) -> LoadResult

Original file from the preview cache, downloaded on a miss.

Source

async fn download_original( &self, asset_id: &str, temp: &Path, edited: bool, ) -> Result<(), String>

Download an original, registered with the download progress tracker.

Source

fn show_load_result(self: &Rc<Self>, load: &PictureLoad, result: LoadResult)

Apply a load result, then slide to the target picture.

Source

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).

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more