Warning, /maui/pix/src/widgets/views/Viewer/GalleryRoll.qml is written in an unsupported language. File is not indexed.

0001 // Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
0002 // Copyright 2018-2020 Nitrux Latinoamericana S.C.
0003 //
0004 // SPDX-License-Identifier: GPL-3.0-or-later
0005 
0006 
0007 import QtQuick 2.14
0008 import QtQuick.Controls 2.14
0009 
0010 import org.mauikit.controls 1.3 as Maui
0011 
0012 import org.maui.pix 1.0
0013 
0014 import "../../../view_models"
0015 
0016 ScrollView
0017 {
0018     id: control
0019 
0020     readonly property alias rollList : rollList
0021     property alias model: rollList.model
0022 
0023     signal picClicked(int index)
0024 
0025     contentHeight: availableHeight
0026 
0027     ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
0028     ScrollBar.vertical.policy: ScrollBar.AlwaysOff
0029 
0030     ListView
0031     {
0032         id: rollList
0033         currentIndex: currentPicIndex
0034         orientation: ListView.Horizontal
0035         clip: true
0036         spacing: 0
0037 
0038         boundsBehavior: Flickable.StopAtBounds
0039         boundsMovement :Flickable.StopAtBounds
0040 
0041         interactive: Maui.Handy.hasTransientTouchInput
0042 
0043         delegate: PixPic
0044         {
0045             height: ListView.view.height
0046             width: height * (isCurrentItem ? 2 : 1)
0047 
0048             isCurrentItem: ListView.isCurrentItem
0049 
0050             labelsVisible: false
0051             fit: false
0052             maskRadius: 0
0053             checkable: false
0054 
0055             onClicked:
0056             {
0057                 rollList.currentIndex = index
0058                 picClicked(index)
0059             }
0060 
0061             onPressAndHold: _picMenu.show()
0062             onRightClicked: _picMenu.show()
0063 
0064             Behavior on width
0065             {
0066                 NumberAnimation
0067                 {
0068                     duration: Maui.Style.units.longDuration
0069                     easing.type: Easing.InQuad
0070                 }
0071             }
0072 
0073         }
0074     }
0075 
0076     function position(index)
0077     {
0078         rollList.currentIndex = index
0079         rollList.positionViewAtIndex(index, ListView.Center)
0080     }
0081 }
0082