Warning, /maui/mauikit/src/controls.6/ScrollColumn.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 
0022 import QtQuick.Controls
0023 import QtQuick.Layouts
0024 
0025 import org.mauikit.controls 1.3 as Maui
0026 
0027 /**
0028  * @inherit QtQuick.Controls.ScrollView
0029  * @brief A QQC2 ScrollView setup ready for adding any children into a column layout that is scrollable.
0030  * <a href="https://doc.qt.io/qt-6/qml-qtquick-controls-scrollview.html">This control inherits from QQC2 ScrollView, to checkout its inherited properties refer to the Qt Docs.</a>
0031  * 
0032  * @note The children content is added to a ColumnLayout, so to position the elements use the Layout attached properties.
0033  *  
0034  * @image html Misc/scrollcolumn.gif
0035  * 
0036  * @code
0037  * Maui.ScrollColumn
0038  * {
0039  *    anchors.fill: parent
0040  * 
0041  *    Rectangle
0042  *    {
0043  *        implicitHeight: 600
0044  *        Layout.fillWidth: true
0045  *        color: "purple"
0046  *    }
0047  * 
0048  *    Rectangle
0049  *    {
0050  *        implicitHeight: 200
0051  *        Layout.fillWidth: true
0052  *        color: "orange"
0053  *    }
0054  * 
0055  *    Rectangle
0056  *    {
0057  *        implicitHeight: 300
0058  *        Layout.fillWidth: true
0059  *        color: "yellow"
0060  *    }
0061  * }
0062  * @endcode
0063  * 
0064  * <a href="https://invent.kde.org/maui/mauikit/-/blob/qt6-2/examples/ScrollColumn.qml">You can find a more complete example at this link.</a>
0065  */
0066 ScrollView
0067 {
0068     id: control
0069     
0070     /**
0071      * @brief The default content declared as the children is placed unser a ColumnLayout.
0072      * @property list<QtObject> ScrollColumn::content
0073      */
0074     default property alias content : _pageContent.data
0075         
0076         /**
0077          * @brief An alias to the children container hanlded by a QQC2 ColumnLayout.
0078          * @property ColumnLayout ScrollColumn::container
0079          */    
0080         readonly property alias container : _pageContent
0081         
0082         /**
0083          * @brief An alias to the QQC2 Flickable element that allows to flick the content. This is exposed to allow to access the Flcikable properties.
0084          * @note See Qt documentation on the Flickable type.
0085          *@property Flickable ScrollColumn::flickable
0086          */
0087         readonly property alias flickable: _flickable
0088         
0089         padding: Maui.Style.contentMargins
0090         
0091         contentWidth: availableWidth
0092         contentHeight: _pageContent.implicitHeight
0093         
0094         implicitHeight: contentHeight + topPadding + bottomPadding
0095         
0096         spacing: Maui.Style.defaultSpacing
0097         
0098         Flickable
0099         {
0100             id: _flickable
0101             
0102             boundsBehavior: Flickable.StopAtBounds
0103             boundsMovement: Flickable.StopAtBounds
0104             
0105             ColumnLayout
0106             {
0107                 id: _pageContent
0108                 width: parent.width
0109                 spacing: control.spacing
0110             }
0111         }
0112 }
0113