AltBrowser

Search for usage in LXR

Inheritance diagram for AltBrowser:

Public Types

enum class  ViewType { Grid , List }
 

Properties

int count
 
int currentIndex
 
Item currentView
 
bool enableLassoSelection
 
Component gridDelegate
 
alias gridView
 
alias holder
 
Component listDelegate
 
alias listView
 
var model
 
bool selectionMode
 
int viewType
 
- Properties inherited from Page
bool altHeader
 
bool autoHideFooter
 
int autoHideFooterDelay
 
int autoHideFooterMargins
 
bool autoHideHeader
 
int autoHideHeaderDelay
 
int autoHideHeaderMargins
 
int bottomMargin
 
alias content
 
Flickable flickable
 
bool floatingFooter
 
bool floatingHeader
 
alias footBar
 
Item footer
 
alias footerColumn
 
alias footerContainer
 
int footerPositioning
 
alias headBar
 
Item header
 
int headerColorSet
 
alias headerColumn
 
alias headerContainer
 
int headerPositioning
 
alias internalHeight
 
int leftMargin
 
int margins
 
alias pageContent
 
int rightMargin
 
bool showTitle
 
string title
 
int topMargin
 

Public Member Functions

void toggle ()
 

Additional Inherited Members

- Signals inherited from Page
void goBackTriggered ()
 
void goForwardTriggered ()
 

Detailed Description

A convinient way of switching between a grid an a list view.

Since
org.mauikit.controls 1.0

This controls inherits from MauiKit Page, to checkout its inherited properties refer to the docs.

See also
Page
Note
This control supports the attached Controls.showCSD property to display the window control buttons when using CSD.

The AltBrowser makes use of the GridView and ListBrowser components, there is a property to dinamically switch between the two.

For some navigation patterns is a good idea to provide a grid view when the application screen size is wide enough to fit numerous items and a list view when the space is contrained - since the list is much more compact - and makes navigation quicker.

See also
viewType
Switching between the list and grid view

Notes

The data model is shared by both of the view types, but the delagates to be used have to be assigment for each one.

See also
listDelegate
gridDelegate

There is a MauiKit Holder element that can be used to display a placeholder message, for example, when the views are empty.

See also
holder
Maui.AltBrowser
{
id: _altBrowser
anchors.fill: parent
Maui.Controls.showCSD: true
viewType: Maui.AltBrowser.ViewType.Grid
gridView.itemSize: 120
headBar.leftContent: ToolButton
{
icon.name: _altBrowser.viewType === Maui.AltBrowser.ViewType.Grid ? "view-list-details" : "view-list-icons"
onClicked: _altBrowser.toggle()
}
model: 20
listDelegate: Maui.ListBrowserDelegate
{
width:ListView.view.width
label1.text: index
label2.text: "Example"
iconSource: "folder"
}
gridDelegate: Maui.GridBrowserDelegate
{
height: GridView.view.cellHeight
width: GridView.view.itemSize
iconSource: "folder"
label1.text: index
label2.text: "Example"
}
}
alias gridView
The GridBrowser used as the grid view alternative.
Component gridDelegate
The delegate to be used by the GridView.
Component listDelegate
The delegate to be used by the ListBrowser.
var model
The shared data model to be used by both view types.
int viewType
Sets the view type that's going to be in use.
alias view
alias headBar
An alias to the default ToolBar as the header bar.
Definition Page.qml:250

You can find a more complete example at this link.

Definition at line 72 of file AltBrowser.qml.

Member Enumeration Documentation

◆ ViewType

enum class AltBrowser::ViewType
strong

Definition at line 94 of file AltBrowser.qml.

Property Documentation

◆ count

int AltBrowser::count
read

The total amount of items in the current view.

Remarks
This property is read-only

Definition at line 157 of file AltBrowser.qml.

◆ currentIndex

int AltBrowser::currentIndex
read

The index of the current item selected in either view type.

This value is synced to both view types.

Definition at line 112 of file AltBrowser.qml.

◆ currentView

Item AltBrowser::currentView
read

The current view being used, the GridView or the ListBrowser.

To access the precise view use the aliases for the GridView or ListView.

See also
listView
gridView
Remarks
This property is read-only

Definition at line 85 of file AltBrowser.qml.

◆ enableLassoSelection

bool AltBrowser::enableLassoSelection
read

Allow the lasso selection for multiple items with mouse or track based input methods.

Definition at line 128 of file AltBrowser.qml.

◆ gridDelegate

Component AltBrowser::gridDelegate
read

The delegate to be used by the GridView.

Definition at line 120 of file AltBrowser.qml.

◆ gridView

alias AltBrowser::gridView
read

The GridBrowser used as the grid view alternative.

Remarks
This property is read-only

Definition at line 146 of file AltBrowser.qml.

◆ holder

alias AltBrowser::holder
read

Item to set a place holder emoji and message.

For more details on its properties check the Holder component.

See also
Holder

Definition at line 140 of file AltBrowser.qml.

◆ listDelegate

Component AltBrowser::listDelegate
read

The delegate to be used by the ListBrowser.

Definition at line 116 of file AltBrowser.qml.

◆ listView

alias AltBrowser::listView
read

The ListBrowser used as the list view alternative.

Remarks
This property is read-only

Definition at line 152 of file AltBrowser.qml.

◆ model

var AltBrowser::model
read

The shared data model to be used by both view types.

Definition at line 124 of file AltBrowser.qml.

◆ selectionMode

bool AltBrowser::selectionMode
read

Allow the selection mode, which sets the views in the mode to accept to select multiple items.

Definition at line 132 of file AltBrowser.qml.

◆ viewType

int AltBrowser::viewType
read

Sets the view type that's going to be in use.

The type can be one of:

  • ViewType.Grid
  • ViewType.List The default
See also
ViewType

Definition at line 107 of file AltBrowser.qml.

Member Function Documentation

◆ toggle()

void AltBrowser::toggle ( )

Toggle between the two views.

If in list view then switches to grid, and from grid to list.


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.