Warning, /maui/nomad-style/Button.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 import QtQuick 2.6
0023 import QtQuick.Templates 2.3 as T
0024 import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate
0025 import org.kde.kirigami 2.3 as Kirigami
0026 
0027 T.Button {
0028     id: controlRoot
0029     implicitWidth: background.implicitWidth
0030     implicitHeight: background.implicitHeight
0031     hoverEnabled: true
0032     contentItem: Text {
0033         text: controlRoot.text
0034         font: controlRoot.font
0035          color: !controlRoot.enabled ? Kirigami.Theme.disabledTextColor :
0036             controlRoot.highlighted || controlRoot.down ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.buttonTextColor
0037         horizontalAlignment: Text.AlignHCenter
0038         verticalAlignment: Text.AlignVCenter
0039         elide: Text.ElideRight
0040     }
0041     
0042     background: Rectangle {
0043         implicitWidth: (Kirigami.Settings.isMobile ? Kirigami.Units.iconSizes.smallMedium : Kirigami.Units.iconSizes.medium) * 2 + Kirigami.Units.smallSpacing
0044         implicitHeight: Kirigami.Settings.isMobile ? Kirigami.Units.iconSizes.smallMedium : Kirigami.Units.iconSizes.medium 
0045      
0046         color: !controlRoot.enabled ? Kirigami.Theme.backgroundColor :
0047                 controlRoot.highlighted || controlRoot.down ? Kirigami.Theme.buttonFocusColor : Kirigami.Theme.buttonBackgroundColor
0048         border.color: controlRoot.hovered ? Kirigami.Theme.buttonHoverColor : Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.7))
0049         border.width: Kirigami.Units.devicePixelRatio
0050         radius: height * 0.05
0051     }
0052 }