Warning, /maui/mauikit/src/controls.5/SectionItem.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.15
0021 import QtQuick.Layouts 1.3
0022
0023 import org.mauikit.controls 1.3 as Maui
0024
0025 /*!
0026 \ since org.*mauikit.controls.labs 1.0
0027 \inqmlmodule org.mauikit.controls.labs
0028 */
0029 Maui.FlexListItem
0030 {
0031 id: control
0032
0033 padding: Maui.Style.defaultPadding
0034 spacing: Maui.Style.space.small
0035
0036 Layout.fillWidth: true
0037 property bool flat : !Maui.Handy.isMobile
0038
0039 hoverEnabled: !Maui.Handy.isMobile
0040
0041 readonly property bool childCheckable : control.content.length >= 2 && control.content[1].hasOwnProperty("checkable") ? control.content[1].checkable : false
0042
0043 background: Rectangle
0044 {
0045 color: control.enabled ? ( control.childCheckable && control.hovered ? Maui.Theme.hoverColor : (control.flat ? "transparent" : Maui.Theme.alternateBackgroundColor)) : "transparent"
0046 radius: Maui.Style.radiusV
0047
0048 Behavior on color
0049 {
0050 enabled: !control.flat
0051 Maui.ColorTransition{}
0052 }
0053 }
0054
0055 onClicked:
0056 {
0057 if(control.childCheckable)
0058 {
0059 control.content[1].toggled()
0060 }
0061 }
0062 }