GalleryRollItem

Search for usage in LXR

GalleryRollItem Class Reference

Properties

bool cache
 
var cb
 
var images
 
int orientation
 

Detailed Description

A custom item to be used as a delegate in the browsing views or as a standalone card. This element presents a group of images in a carousel form.

Since
org.mauikit.controls

This control inherits all properties from the MauiKit GridBrowserDelegate control. As such, this can have two labels, for a title and a message.

See also
GridBrowserDelegate::label1
GridBrowserDelegate::label2

The header part of this control, the actual carousel of images, is handled by a GalleryRollTemplate.

See also
GalleryRollTemplate
Maui.GridBrowser
{
anchors.fill: parent
model: 30
itemSize: 200
delegate: Item
{
width: GridView.view.cellWidth
height: GridView.view.cellHeight
Maui.GalleryRollItem
{
anchors.fill: parent
anchors.margins: Maui.Style.space.small
label1.text: "Demo"
label2.text: index
images: index %2 === 0 ? ['/home/camiloh/Downloads/street-1234360.jpg', '/home/camiloh/Downloads/flat-coated-retriever-1339154.jpg', '/home/camiloh/Downloads/5911329.jpeg'] : ['/home/camiloh/Downloads/street-1234360.jpg', '/home/camiloh/Downloads/flat-coated-retriever-1339154.jpg', '/home/camiloh/Downloads/5911329.jpeg', '/home/camiloh/Pictures/LastLights_by_Mushcube/LastLightsScreenPreview.png']
}
}
}
var images
A list of images to be used.
alias view

You can find a more complete example at this link.

Definition at line 48 of file GalleryRollItem.qml.

Property Documentation

◆ cache

bool GalleryRollItem::cache
read

Whether the images should be saved in the cache, to reduce loading times.

By default this is set to true.

Definition at line 54 of file GalleryRollItem.qml.

◆ cb

var GalleryRollItem::cb
read

A callback function to manage what image is positioned.

This callback function is called for each image source set in the model images, so the final source can be modified. This function should return a - new or modified - image source URL.

As an example, if the images model looks like: ["page1", "page2", "page3"] - which are not file URLs, this callback function can be use to map each individual source to an actual file URL.

images: ["page1", "page2", "page3"]
cb : (source) =>
{
return mapSourceToImageFile(source) //here the "page1" could be mapped to "file:///some/path/to/image1.jpg" and return this new source to be use.
}
var cb
A callback function to manage what image is positioned.

Definition at line 71 of file GalleryRollItem.qml.

◆ images

var GalleryRollItem::images
read

A list of images to be used.

This will be use as the model.

Definition at line 58 of file GalleryRollItem.qml.

◆ orientation

int GalleryRollItem::orientation
read

The orientation of the transition of the images.

By default this is set to horizontal using ListView.Horizontal. Possible values are:

  • ListView.Horizontal
  • ListView.Vertical

Definition at line 78 of file GalleryRollItem.qml.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:06:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.