Skip to main content

MasonryCanvas

Struct MasonryCanvas 

Source
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)>>>§context_menu_handler: RefCell<Option<Rc<RefCell<Option<Box<dyn Fn(u32, f64, f64)>>>>>>§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

Source

fn register_type()

Registers the type only once.

Source§

impl MasonryCanvas

Source

pub fn downgrade(&self) -> <Self as Downgrade>::Weak

Source§

impl MasonryCanvas

Source

fn cfg(&self) -> LayoutConfig

Source

fn layout_for_width(&self, width: f32) -> f32

Source

pub(super) fn invalidate_layout(&self)

Source

fn snapshot_ctx<'a>( &'a self, model: &'a LibraryAssetModel, cache: &'a Arc<ThumbnailCache>, ) -> SnapshotCtx<'a>

Source

fn snapshot_viewport(&self) -> SnapshotViewport

Source

fn paint_snapshot_rows( &self, snapshot: &Snapshot, sctx: &SnapshotCtx<'_>, rows: &[LaidRow], viewport: &SnapshotViewport, ) -> (SnapshotStats, Vec<LoadRequest>)

Source

fn paint_row( &self, snapshot: &Snapshot, sctx: &SnapshotCtx<'_>, row: &LaidRow, viewport: &SnapshotViewport, stats: &mut SnapshotStats, to_load: &mut Vec<LoadRequest>, )

Source

fn paint_item( &self, snapshot: &Snapshot, sctx: &SnapshotCtx<'_>, row: &LaidRow, it: &LaidItem, row_in_viewport: bool, ) -> PaintResult

Source

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.

Source

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.

Source

fn paint_checked_box( &self, snapshot: &Snapshot, bx: f32, by: f32, box_size: f32, )

Accent-filled square with a checkmark icon.

Source

fn paint_unchecked_box(snapshot: &Snapshot, bx: f32, by: f32, box_size: f32)

Bordered empty square (outline only).

Source

fn queue_load_if_needed( &self, model: &LibraryAssetModel, it: &LaidItem, row: &LaidRow, viewport_center: f32, bucket: ThumbnailSize, to_load: &mut Vec<LoadRequest>, )

Source

fn load_is_blocked(&self, asset_id: &str, bucket: ThumbnailSize) -> bool

Source

fn finish_snapshot( &self, cache: &ThumbnailCache, viewport: &SnapshotViewport, stats: &SnapshotStats, to_load: &mut Vec<LoadRequest>, )

Source

fn log_snapshot( &self, cache: &ThumbnailCache, viewport: &SnapshotViewport, stats: &SnapshotStats, queued: usize, )

Source

fn viewport(&self) -> (f32, f32)

Source

fn find_vadjustment(&self) -> Option<Adjustment>

Source

fn spawn_load(&self, request: LoadRequest)

Trait Implementations§

Source§

impl Default for MasonryCanvas

Source§

fn default() -> MasonryCanvas

Returns the “default value” for a type. Read more
Source§

impl ObjectImpl for MasonryCanvas

Source§

fn constructed(&self)

Constructed. Read more
§

fn properties() -> &'static [ParamSpec]

Properties installed for this type.
§

fn signals() -> &'static [Signal]

Signals installed for this type.
§

fn set_property(&self, _id: usize, _value: &Value, _pspec: &ParamSpec)

Property setter. Read more
§

fn property(&self, _id: usize, _pspec: &ParamSpec) -> Value

Property getter. Read more
§

fn dispose(&self)

Disposes of the object. Read more
§

fn notify(&self, pspec: &ParamSpec)

Function to be called when property change is notified for with self.notify("property").
§

fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])

Source§

impl ObjectSubclass for MasonryCanvas

Source§

const NAME: &str = "MimickMasonryCanvas"

GObject type name. Read more
Source§

type Interfaces = ()

List of interfaces implemented by this type.
Source§

type Class = ClassStruct<MasonryCanvas>

The C class struct. Read more
Source§

type Instance = InstanceStruct<MasonryCanvas>

The C instance struct. Read more
Source§

type Type = MasonryCanvas

Wrapper around this subclass defined with wrapper!
Source§

type ParentType = Widget

Parent Rust type to inherit from.
Source§

fn new() -> Self

Constructor. Read more
§

const ABSTRACT: bool = false

If this subclass is an abstract class or not. Read more
§

const FINAL: bool = false

If this subclass is a final class or not. Read more
§

const DEPRECATED: bool = false

If this subclass is a deprecated class or not. Read more
§

const ALLOW_NAME_CONFLICT: bool = false

Allow name conflicts for this class. Read more
§

fn type_init(_type_: &mut InitializingType<Self>)

Additional type initialization. Read more
§

fn class_init(_klass: &mut Self::Class)

Class initialization. Read more
§

fn with_class(_klass: &Self::Class) -> Self

Constructor. Read more
§

fn instance_init(_obj: &InitializingObject<Self>)

Performs additional instance initialization. Read more
Source§

impl ObjectSubclassType for MasonryCanvas

Source§

fn type_data() -> NonNull<TypeData>

Storage for the type-specific data used during registration.
Source§

fn type_() -> Type

Returns the glib::Type ID of the subclass. Read more
Source§

impl WidgetImpl for MasonryCanvas

Source§

fn request_mode(&self) -> SizeRequestMode

Source§

fn measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)

Source§

fn size_allocate(&self, width: i32, _height: i32, _baseline: i32)

Source§

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 hide(&self)

👎Deprecated:

Since 4.10

§

fn keynav_failed(&self, direction_type: DirectionType) -> 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 show(&self)

👎Deprecated:

Since 4.10

§

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§

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<T, Ctx> BundleDefault<Ctx> for T
where T: Default,

§

fn default_with_context(_: Ctx) -> T

Creates a default value with the given context.
§

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> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> ObjectImplExt for T
where T: ObjectImpl,

§

fn parent_constructed(&self)

Chain up to the parent class’ implementation of glib::Object::constructed().
§

fn parent_notify(&self, pspec: &ParamSpec)

Chain up to the parent class’ implementation of glib::Object::notify().
§

fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])

Chain up to the parent class’ implementation of glib::Object::dispatch_properties_changed().
§

fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>

Chain up to parent class signal handler.
§

impl<T> ObjectSubclassExt for T
where T: ObjectSubclass,

§

fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>

Returns the corresponding object instance. Read more
§

fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T

Returns the implementation from an instance. Read more
§

fn ref_counted(&self) -> ObjectImplRef<T>

Returns a new reference-counted wrapper around self.
§

fn instance_data<U>(&self, type_: Type) -> Option<&U>
where U: Any + Send + Sync + 'static,

Returns a pointer to the instance implementation specific data. 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> WidgetImplExt for T
where 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)

👎Deprecated:

Since 4.10

§

fn parent_keynav_failed(&self, direction_type: DirectionType) -> bool

§

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)

👎Deprecated:

Since 4.10

§

fn parent_size_allocate(&self, width: i32, height: i32, baseline: i32)

§

fn parent_snapshot(&self, snapshot: &Snapshot)

§

fn parent_state_flags_changed(&self, state_flags: &StateFlags)

§

fn parent_system_setting_changed(&self, settings: &SystemSetting)

§

fn parent_unmap(&self)

§

fn parent_unrealize(&self)

§

fn parent_unroot(&self)

§

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