Warning, /plasma-bigscreen/peertube-voice-application/ui/views/TileView.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  Copyright 2019 Aditya Mehra <aix.m@outlook.com>
0003  *  Copyright 2019 Marco Martin <mart@kde.org>
0004  *
0005  *  This program is free software; you can redistribute it and/or modify
0006  *  it under the terms of the GNU General Public License as published by
0007  *  the Free Software Foundation; either version 2 of the License, or
0008  *  (at your option) any later version.
0009  *
0010  *  This program is distributed in the hope that it will be useful,
0011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  *  GNU General Public License for more details.
0014  *
0015  *  You should have received a copy of the GNU General Public License
0016  *  along with this program; if not, write to the Free Software
0017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  2.010-1301, USA.
0018  */
0019 
0020 import QtQuick 2.12
0021 import QtQuick.Layouts 1.4
0022 import QtQuick.Controls 2.4 as Controls
0023 import org.kde.plasma.components 3.0 as PlasmaComponents
0024 import org.kde.kirigami 2.5 as Kirigami
0025 
0026 
0027 FocusScope {
0028     id: root
0029     signal activated
0030     property string title
0031     property alias view: view
0032     property alias delegate: view.delegate
0033     property alias model: view.model
0034     property alias count: view.count
0035     property alias currentIndex: view.currentIndex
0036     property alias currentItem: view.currentItem
0037     Layout.fillWidth: true
0038     implicitHeight: view.implicitHeight + Kirigami.Units.largeSpacing
0039     property alias cellWidth: view.cellWidth
0040     property alias cellHeight: view.cellHeight
0041     
0042     property Item navigationUp
0043     property Item navigationDown
0044 
0045     GridView {
0046         id: view
0047         anchors {
0048                 left: parent.left
0049                 right: parent.right
0050                 top: parent.top
0051                 bottom: parent.bottom
0052                 topMargin: Kirigami.Units.largeSpacing * 2
0053                 leftMargin: Kirigami.Units.largeSpacing * 2
0054                 rightMargin: Kirigami.Units.largeSpacing * 2
0055         }
0056         focus: true
0057         z: activeFocus ? 10: 1 
0058         cellWidth: parent.width / 4
0059         cellHeight: parent.height / 1.5
0060         keyNavigationEnabled: true
0061         highlightFollowsCurrentItem: true
0062         highlightRangeMode: GridView.ApplyRange
0063         snapMode: GridView.SnapToRow
0064         cacheBuffer: width
0065         highlightMoveDuration: Kirigami.Units.longDuration
0066         clip: true
0067         
0068         onCurrentItemChanged: {
0069             positionViewAtIndex(view.currentIndex, GridView.SnapPosition)
0070         }
0071         
0072         move: Transition {
0073             SmoothedAnimation {
0074                 property: "x"
0075                 duration: Kirigami.Units.longDuration
0076             }
0077         }
0078 
0079         KeyNavigation.left: root
0080         KeyNavigation.right: root
0081     }
0082 }
0083