Warning, /maui/mauikit/src/style.5/CheckBox.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright 2017 Marco Martin <mart@kde.org>
0003  * Copyright 2017 The Qt Company Ltd.
0004  *
0005  * GNU Lesser General Public License Usage
0006  * Alternatively, this file may be used under the terms of the GNU Lesser
0007  * General Public License version 3 as published by the Free Software
0008  * Foundation and appearing in the file LICENSE.LGPLv3 included in the
0009  * packaging of this file. Please review the following information to
0010  * ensure the GNU Lesser General Public License version 3 requirements
0011  * will be met: https://www.gnu.org/licenses/lgpl.html.
0012  *
0013  * GNU General Public License Usage
0014  * Alternatively, this file may be used under the terms of the GNU
0015  * General Public License version 2.0 or later as published by the Free
0016  * Software Foundation and appearing in the file LICENSE.GPL included in
0017  * the packaging of this file. Please review the following information to
0018  * ensure the GNU General Public License version 2.0 requirements will be
0019  * met: http://www.gnu.org/licenses/gpl-2.0.html.
0020  */
0021 
0022 
0023 import QtQuick 2.6
0024 import QtQuick.Templates 2.3 as T
0025 import org.mauikit.controls 1.3 as Maui
0026 
0027 import "private"
0028 
0029 T.CheckBox 
0030 {
0031     id: controlRoot
0032     opacity: enabled ? 1 : 0.5
0033     
0034     implicitWidth: Math.max(contentItem.implicitWidth, indicator ? indicator.implicitWidth : 0) + leftPadding + rightPadding
0035     implicitHeight: Math.max(contentItem.implicitHeight, indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding
0036 
0037     padding: 0
0038     spacing: Maui.Style.space.small  
0039     
0040     hoverEnabled: true
0041 
0042     indicator: CheckIndicator
0043     {
0044         x: controlRoot.text ? (controlRoot.mirrored ? controlRoot.width - width - controlRoot.rightPadding : controlRoot.leftPadding) : controlRoot.leftPadding + (controlRoot.availableWidth - width) / 2
0045         y: controlRoot.topPadding + (controlRoot.availableHeight - height) / 2
0046         control: controlRoot
0047     }
0048 
0049     contentItem: Label
0050     {
0051         leftPadding: controlRoot.indicator && !controlRoot.mirrored ? controlRoot.indicator.width + controlRoot.spacing : 0
0052         rightPadding: controlRoot.indicator && controlRoot.mirrored ? controlRoot.indicator.width + controlRoot.spacing : 0
0053         text: controlRoot.text
0054         font: controlRoot.font
0055         elide: Text.ElideRight
0056         visible: controlRoot.text
0057         horizontalAlignment: Text.AlignLeft
0058         verticalAlignment: Text.AlignVCenter
0059     }
0060     
0061     background: null
0062 }