Warning, /graphics/kphotoalbum/AndroidRemoteControl/qml/OverviewPage.qml is written in an unsupported language. File is not indexed.

0001 /* SPDX-FileCopyrightText: 2014 Jesper K. Pedersen <blackie@kde.org>
0002 
0003    SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 import QtQuick 2.0
0007 import KPhotoAlbum 1.0
0008 
0009 PinchArea {
0010     id: root
0011     anchors.fill: parent
0012     pinch.minimumScale: 0.1
0013     pinch.maximumScale: 10
0014 
0015     onPinchStarted: {
0016         initialSize = _settings.overviewIconSize
0017     }
0018 
0019     onPinchUpdated: {
0020         iconScale =  1 + (pinch.scale-1)*0.25
0021         _settings.overviewIconSize = initialSize * iconScale
0022     }
0023 
0024     onPinchFinished: {
0025         iconScale = 1
0026         _remoteInterface.rerequestOverviewPageData()
0027     }
0028 
0029     property double iconScale : 1
0030     property double initialSize
0031 
0032     Flickable {
0033         id: flickable
0034         anchors.fill: parent
0035         contentWidth: grid.width
0036         contentHeight: grid.height
0037         flickableDirection: Flickable.VerticalFlick
0038 
0039         Grid {
0040             id: grid
0041             x: Math.max(0, (flickable.width - width) /2)
0042             y: Math.max(0, (flickable.height - height)/2)
0043             columns: _screenInfo.overviewColumnCount
0044             spacing: _screenInfo.overviewSpacing
0045 
0046             Icon {
0047                 text: "home"
0048                 icon: _remoteInterface.home
0049                 width: _screenInfo.overviewIconSize
0050                 iconScale: root.iconScale
0051                 onClicked: _remoteInterface.goHome()
0052             }
0053 
0054             Repeater {
0055                 model: _remoteInterface.categories
0056                 delegate: Icon {
0057                     enabled: model.enabled
0058                     text: model.name
0059                     icon: model.icon
0060                     width: _screenInfo.overviewIconSize
0061                     iconScale: root.iconScale
0062                     onClicked: _remoteInterface.selectCategory(model.name, model.type)
0063                 }
0064             }
0065 
0066             Icon {
0067                 text: "Discover"
0068                 icon: _remoteInterface.discoveryImage
0069                 width: _screenInfo.overviewIconSize
0070                 iconScale: root.iconScale
0071                 onClicked: _remoteInterface.doDiscovery()
0072             }
0073 
0074             Icon {
0075                 text: "View"
0076                 icon: _remoteInterface.kphotoalbum
0077                 width: _screenInfo.overviewIconSize
0078                 iconScale: root.iconScale
0079                 onClicked: _remoteInterface.showThumbnails()
0080             }
0081         }
0082     }
0083     Rectangle {
0084         anchors.fill: parent
0085         color: _settings.backgroundColor
0086         opacity: _remoteInterface.categories.hasData ? 0 : 1
0087         visible: opacity != 0
0088         Behavior on opacity { NumberAnimation { duration: 300 } }
0089     }
0090 }
0091