Warning, /maui/mauikit/src/controls.5/FlexListItem.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 2.14
0021 import QtQuick.Controls 2.14
0022 import QtQuick.Layouts 1.3
0023 
0024 import org.mauikit.controls 1.2 as Maui
0025 
0026 import QtQuick.Templates 2.15 as T
0027 
0028 /*!
0029   \since org.mauikit.controls.labs 1.0
0030   \inqmlmodule org.mauikit.controls.labs
0031 
0032   A template to position text besides an icon or image with a flex content side, that flexes under constrained spaces.
0033 */
0034 T.ItemDelegate
0035 {
0036     id: control
0037 
0038     /**
0039       *
0040       */
0041     // default property alias content : _content.data
0042      default property alias content : _layout.data
0043        
0044         
0045     /**
0046       *
0047       */
0048     property alias template: _template
0049 
0050     /**
0051       *
0052       */
0053     property alias label1 : _template.label1
0054 
0055     /**
0056       *
0057       */
0058     property alias label2 : _template.label2
0059 
0060     /**
0061       *
0062       */
0063     property alias label3 : _template.label3
0064 
0065     /**
0066       *
0067       */
0068     property alias label4 : _template.label4
0069 
0070     /**
0071       *
0072       */
0073     property alias iconSource : _template.iconSource
0074 
0075     /**
0076       *
0077       */
0078     property alias imageSource : _template.imageSource
0079 
0080     /**
0081       *
0082       */
0083     property alias iconSizeHint : _template.iconSizeHint
0084 
0085     /**
0086       *
0087       */
0088     property bool wide : _layout.children[1] ? _layout.children[1].implicitWidth < _layout.width*0.5 : true
0089 
0090     property alias rowSpacing : _layout.rowSpacing
0091 
0092     property alias columnSpacing: _layout.columnSpacing    
0093     
0094     property alias columns: _layout.columns
0095     property alias rows: _layout.rows    
0096 
0097     implicitHeight: _layout.implicitHeight + topPadding + bottomPadding
0098 
0099     background: null
0100     
0101     spacing: Maui.Style.defaultSpacing
0102     
0103     contentItem: GridLayout
0104     {
0105         id: _layout
0106         
0107         rowSpacing: control.spacing
0108         columnSpacing: control.spacing
0109         
0110         columns: control.wide ? 2 : 1
0111         
0112         Maui.ListItemTemplate
0113         {
0114             id: _template
0115             Layout.fillWidth: true
0116             iconSizeHint: Maui.Style.iconSizes.medium
0117             label2.wrapMode: Text.WordWrap
0118             label1.font.weight: Font.Medium
0119         }
0120     }
0121 }