Warning, /maui/mauikit/src/controls.6/ListDelegate.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * Copyright 2018 Camilo Higuita <milo.h@aol.com>
0003 *
0004 * This program is free software; you can redistribute it and/or modify
0005 * it under the terms of the GNU Library General Public License as
0006 * published by the Free Software Foundation; either version 2, or
0007 * (at your option) any later version.
0008 *
0009 * This program is distributed in the hope that it will be useful,
0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012 * GNU General Public License for more details
0013 *
0014 * You should have received a copy of the GNU Library General Public
0015 * License along with this program; if not, write to the
0016 * Free Software Foundation, Inc.,
0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018 */
0019
0020 import QtQuick
0021 import QtQuick.Controls
0022
0023 import org.mauikit.controls 1.3 as Maui
0024
0025 /**
0026 * @inherit ItemDelegate
0027 * @brief A basic delagate for a label and an icon, to be used in a list browser.
0028 * This controls inherits from MauiKit ItemDelegate, to checkout its inherited properties refer to docs.
0029 *
0030 * @note This is a simplified version fo the ListBrowserDelegate. The main difference is this one is not checkable.
0031 */
0032 Maui.ItemDelegate
0033 {
0034 id: control
0035
0036 implicitHeight: _template.implicitHeight + topPadding + bottomPadding
0037
0038 padding: Maui.Style.defaultPadding
0039 spacing: Maui.Style.space.medium
0040
0041 /**
0042 * @see ListItemTemplate::labelsVisible
0043 */
0044 property alias labelVisible : _template.labelsVisible
0045
0046 /**
0047 * @see ListItemTemplate::iconSizeHint
0048 */
0049 property alias iconSize : _template.iconSizeHint
0050
0051 /**
0052 * @see ListItemTemplate::iconVisible
0053 */
0054 property alias iconVisible : _template.iconVisible
0055
0056 /**
0057 * @see ListItemTemplate::text1
0058 */
0059 property alias label: _template.text1
0060
0061 /**
0062 * @see ListItemTemplate::text2
0063 */
0064 property alias label2: _template.text2
0065
0066 /**
0067 * @see ListItemTemplate::iconSource
0068 */
0069 property alias iconName: _template.iconSource
0070
0071 /**
0072 * @see An alias to the template item handling the information.
0073 * @property ListItemTemplate ListDelegate::template
0074 */
0075 property alias template : _template
0076
0077 isCurrentItem : ListView.isCurrentItem
0078
0079 ToolTip.delay: 1000
0080 ToolTip.timeout: 5000
0081 ToolTip.visible: hovered
0082 ToolTip.text: control.label
0083
0084 Maui.ListItemTemplate
0085 {
0086 id: _template
0087 spacing: control.spacing
0088
0089 anchors.fill: parent
0090 hovered: control.hovered
0091 isCurrentItem: control.isCurrentItem
0092 highlighted: control.containsPress
0093 }
0094 }