Warning, /system/mycroft-gui/import/qml/Delegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright 2018 by Marco Martin <mart@kde.org>
0003  * Copyright 2018 David Edmundson <davidedmundson@kde.org>
0004  *
0005  * Licensed under the Apache License, Version 2.0 (the "License");
0006  * you may not use this file except in compliance with the License.
0007  * You may obtain a copy of the License at
0008  *
0009  *    http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  *
0017  */
0018 
0019 //DEPRECATED or inherit fom c++ Delegate?
0020 import QtQuick 2.15
0021 import QtQuick.Controls 2.15 as Controls
0022 import org.kde.kirigami 2.19 as Kirigami
0023 import Mycroft 1.0 as Mycroft
0024 
0025 //TODO: should all delegates be a Kirigami Page?
0026 Mycroft.AbstractDelegate {
0027     id: control
0028 
0029     signal backRequested
0030 
0031     skillBackgroundColorOverlay: Kirigami.Theme.textColor.hsvValue > 0.5 ? Qt.rgba(0,0,0, 0.4) : Qt.rgba(1,1,1, 0.4)
0032 
0033     property Component controlBar
0034 
0035     readonly property Item controlBarItem: {
0036         if (controlBar) {
0037             return controlBar.createObject(control, {"z": 9999});
0038         } else {
0039             return null;
0040         }
0041     }
0042 
0043     //To do some automatic responsive layouting
0044     readonly property bool wideMode: width > Kirigami.Units.gridUnit * 18
0045 
0046     leftPadding: Kirigami.Units.largeSpacing
0047     topPadding: Kirigami.Units.largeSpacing
0048     rightPadding: Kirigami.Units.largeSpacing
0049     bottomPadding: Kirigami.Units.largeSpacing
0050 }