pub struct MasonryCanvas {Show 23 fields
pub model: OnceCell<LibraryAssetModel>,
pub cache: OnceCell<Arc<ThumbnailCache>>,
pub selection: OnceCell<MultiSelection>,
pub narrow: Cell<bool>,
pub select_mode: Cell<bool>,
pub quality: Cell<GridQuality>,
pub rows: RefCell<Vec<LaidRow>>,
pub cached_width: Cell<f32>,
pub layout_h: Cell<f32>,
pub pending: RefCell<HashSet<String>>,
pub failed: RefCell<HashSet<String>>,
pub vadjustment: RefCell<Option<Adjustment>>,
pub activate_handler: RefCell<Option<Rc<dyn Fn(u32)>>>,
pub context_menu_handler: RefCell<Option<Rc<RefCell<Option<Box<dyn Fn(u32, f64, f64)>>>>>>,
pub select_mode_changer: RefCell<Option<Rc<dyn Fn(bool)>>>,
pub last_selected: Cell<Option<u32>>,
pub permission_warned: Cell<bool>,
pub video_icon: OnceCell<Paintable>,
pub check_icon: OnceCell<Paintable>,
pub uncheck_icon: OnceCell<Paintable>,
pub drag_active: Cell<bool>,
pub border_gap: Cell<f32>,
pub border_color: Cell<Option<RGBA>>,
}Fields§
§model: OnceCell<LibraryAssetModel>§cache: OnceCell<Arc<ThumbnailCache>>§selection: OnceCell<MultiSelection>§narrow: Cell<bool>§select_mode: Cell<bool>§quality: Cell<GridQuality>§rows: RefCell<Vec<LaidRow>>§cached_width: Cell<f32>§layout_h: Cell<f32>§pending: RefCell<HashSet<String>>§failed: RefCell<HashSet<String>>Permanently failed ids; skipped to avoid re-queueing every frame.
vadjustment: RefCell<Option<Adjustment>>§activate_handler: RefCell<Option<Rc<dyn Fn(u32)>>>§select_mode_changer: RefCell<Option<Rc<dyn Fn(bool)>>>§last_selected: Cell<Option<u32>>Anchor position for Shift+Click range selection.
permission_warned: Cell<bool>§video_icon: OnceCell<Paintable>Cached video badge icon paintable, resolved lazily from the icon theme.
check_icon: OnceCell<Paintable>Cached checkbox icon (selected state).
uncheck_icon: OnceCell<Paintable>Cached checkbox icon (unselected state).
drag_active: Cell<bool>True while a drag-out operation is in progress; suppresses click-to-activate.
border_gap: Cell<f32>Configurable gap between grid tiles, in pixels.
border_color: Cell<Option<RGBA>>Color painted behind tiles so the gap appears as a border.
Implementations§
Source§impl MasonryCanvas
impl MasonryCanvas
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl MasonryCanvas
impl MasonryCanvas
Source§impl MasonryCanvas
impl MasonryCanvas
fn cfg(&self) -> LayoutConfig
fn layout_for_width(&self, width: f32) -> f32
pub(super) fn invalidate_layout(&self)
fn snapshot_ctx<'a>( &'a self, model: &'a LibraryAssetModel, cache: &'a Arc<ThumbnailCache>, ) -> SnapshotCtx<'a>
fn snapshot_viewport(&self) -> SnapshotViewport
fn paint_snapshot_rows( &self, snapshot: &Snapshot, sctx: &SnapshotCtx<'_>, rows: &[LaidRow], viewport: &SnapshotViewport, ) -> (SnapshotStats, Vec<LoadRequest>)
fn paint_row( &self, snapshot: &Snapshot, sctx: &SnapshotCtx<'_>, row: &LaidRow, viewport: &SnapshotViewport, stats: &mut SnapshotStats, to_load: &mut Vec<LoadRequest>, )
fn paint_item( &self, snapshot: &Snapshot, sctx: &SnapshotCtx<'_>, row: &LaidRow, it: &LaidItem, row_in_viewport: bool, ) -> PaintResult
Sourcefn paint_video_badge(
&self,
snapshot: &Snapshot,
cell_x: f32,
cell_y: f32,
cell_w: f32,
cell_h: f32,
)
fn paint_video_badge( &self, snapshot: &Snapshot, cell_x: f32, cell_y: f32, cell_w: f32, cell_h: f32, )
Paint the video play-icon badge centred on the cell.
A semi-transparent dark circle is drawn behind the icon for contrast,
then the cached mimick-video-symbolic icon is rendered on top.
Sourcefn paint_checkbox(
&self,
snapshot: &Snapshot,
cell_x: f32,
cell_y: f32,
cell_h: f32,
selected: bool,
)
fn paint_checkbox( &self, snapshot: &Snapshot, cell_x: f32, cell_y: f32, cell_h: f32, selected: bool, )
Paint a checkbox indicator in the top-left corner of a tile.
Sourcefn paint_checked_box(
&self,
snapshot: &Snapshot,
bx: f32,
by: f32,
box_size: f32,
)
fn paint_checked_box( &self, snapshot: &Snapshot, bx: f32, by: f32, box_size: f32, )
Accent-filled square with a checkmark icon.
Sourcefn paint_unchecked_box(snapshot: &Snapshot, bx: f32, by: f32, box_size: f32)
fn paint_unchecked_box(snapshot: &Snapshot, bx: f32, by: f32, box_size: f32)
Bordered empty square (outline only).
fn queue_load_if_needed( &self, model: &LibraryAssetModel, it: &LaidItem, row: &LaidRow, viewport_center: f32, bucket: ThumbnailSize, to_load: &mut Vec<LoadRequest>, )
fn load_is_blocked(&self, asset_id: &str, bucket: ThumbnailSize) -> bool
fn finish_snapshot( &self, cache: &ThumbnailCache, viewport: &SnapshotViewport, stats: &SnapshotStats, to_load: &mut Vec<LoadRequest>, )
fn log_snapshot( &self, cache: &ThumbnailCache, viewport: &SnapshotViewport, stats: &SnapshotStats, queued: usize, )
fn viewport(&self) -> (f32, f32)
fn find_vadjustment(&self) -> Option<Adjustment>
fn spawn_load(&self, request: LoadRequest)
Trait Implementations§
Source§impl Default for MasonryCanvas
impl Default for MasonryCanvas
Source§fn default() -> MasonryCanvas
fn default() -> MasonryCanvas
Source§impl ObjectImpl for MasonryCanvas
impl ObjectImpl for MasonryCanvas
Source§fn constructed(&self)
fn constructed(&self)
§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
§fn set_property(&self, _id: usize, _value: &Value, _pspec: &ParamSpec)
fn set_property(&self, _id: usize, _value: &Value, _pspec: &ParamSpec)
§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
self.notify("property").fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Source§impl ObjectSubclass for MasonryCanvas
impl ObjectSubclass for MasonryCanvas
Source§type Interfaces = ()
type Interfaces = ()
Source§type Class = ClassStruct<MasonryCanvas>
type Class = ClassStruct<MasonryCanvas>
Source§type Instance = InstanceStruct<MasonryCanvas>
type Instance = InstanceStruct<MasonryCanvas>
Source§type Type = MasonryCanvas
type Type = MasonryCanvas
wrapper!Source§type ParentType = Widget
type ParentType = Widget
§const DEPRECATED: bool = false
const DEPRECATED: bool = false
§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
§fn class_init(_klass: &mut Self::Class)
fn class_init(_klass: &mut Self::Class)
§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
§fn instance_init(_obj: &InitializingObject<Self>)
fn instance_init(_obj: &InitializingObject<Self>)
Source§impl ObjectSubclassType for MasonryCanvas
impl ObjectSubclassType for MasonryCanvas
Source§impl WidgetImpl for MasonryCanvas
impl WidgetImpl for MasonryCanvas
fn request_mode(&self) -> SizeRequestMode
fn measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)
fn size_allocate(&self, width: i32, _height: i32, _baseline: i32)
fn snapshot(&self, snapshot: &Snapshot)
fn compute_expand(&self, hexpand: &mut bool, vexpand: &mut bool)
fn contains(&self, x: f64, y: f64) -> bool
fn direction_changed(&self, previous_direction: TextDirection)
fn focus(&self, direction_type: DirectionType) -> bool
fn grab_focus(&self) -> bool
fn map(&self)
fn mnemonic_activate(&self, group_cycling: bool) -> bool
fn move_focus(&self, direction_type: DirectionType)
fn query_tooltip( &self, x: i32, y: i32, keyboard_tooltip: bool, tooltip: &Tooltip, ) -> bool
fn realize(&self)
fn root(&self)
fn set_focus_child(&self, child: Option<&Widget>)
fn state_flags_changed(&self, state_flags: &StateFlags)
fn system_setting_changed(&self, settings: &SystemSetting)
fn unmap(&self)
fn unrealize(&self)
fn unroot(&self)
Auto Trait Implementations§
impl !Freeze for MasonryCanvas
impl !RefUnwindSafe for MasonryCanvas
impl !Send for MasonryCanvas
impl !Sync for MasonryCanvas
impl !UnwindSafe for MasonryCanvas
impl Unpin for MasonryCanvas
impl UnsafeUnpin for MasonryCanvas
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<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> 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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
§fn parent_constructed(&self)
fn parent_constructed(&self)
glib::Object::constructed().§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
glib::Object::notify().§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
glib::Object::dispatch_properties_changed().§fn signal_chain_from_overridden(
&self,
token: &SignalClassHandlerToken,
values: &[Value],
) -> Option<Value>
fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>
§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
self.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WidgetImplExt for Twhere
T: WidgetImpl,
impl<T> WidgetImplExt for Twhere
T: WidgetImpl,
fn parent_compute_expand(&self, hexpand: &mut bool, vexpand: &mut bool)
fn parent_contains(&self, x: f64, y: f64) -> bool
fn parent_direction_changed(&self, previous_direction: TextDirection)
fn parent_focus(&self, direction_type: DirectionType) -> bool
fn parent_request_mode(&self) -> SizeRequestMode
fn parent_grab_focus(&self) -> bool
§fn parent_hide(&self)
fn parent_hide(&self)
Since 4.10
fn parent_map(&self)
fn parent_measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)
fn parent_mnemonic_activate(&self, group_cycling: bool) -> bool
fn parent_move_focus(&self, direction_type: DirectionType)
fn parent_query_tooltip( &self, x: i32, y: i32, keyboard_tooltip: bool, tooltip: &Tooltip, ) -> bool
fn parent_realize(&self)
fn parent_root(&self)
fn parent_set_focus_child(&self, child: Option<&Widget>)
§fn parent_show(&self)
fn parent_show(&self)
Since 4.10