Warning, /plasma-mobile/plasma-phonebook/src/contents/ui/components/ActionButton.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 Mathis BrĂ¼chert <mbb@kaidan.im>
0002 //
0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 import QtQuick 2.1
0006 import QtQuick.Controls 2.12 as Controls
0007 import QtQuick.Layouts 1.3
0008 import org.kde.kirigami 2.19 as Kirigami
0009 import org.kde.phonebook 1.0
0010 
0011 import ".."
0012 
0013 
0014 Controls.Button {
0015     id: root
0016     property Kirigami.Action singleAction
0017 
0018     property int margin: 10
0019 
0020     height: 55
0021     width: 55
0022     background: Kirigami.ShadowedRectangle{
0023         Kirigami.Theme.inherit: false
0024         Kirigami.Theme.colorSet: Kirigami.Theme.Window
0025         border.width: 1
0026         border.color: if (parent.down){
0027                 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.4)
0028             }else if(parent.hovered){
0029                 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.6)
0030             }else{
0031                 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, 0.2)
0032             }
0033         color: if (parent.down){
0034                 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.6)
0035             }else if(parent.hovered){
0036                 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.8)
0037             }else{
0038                 Kirigami.Theme.backgroundColor
0039             }
0040         shadow.size: 10
0041         shadow.xOffset: 2
0042         shadow.yOffset: 2
0043         shadow.color: Qt.rgba(0, 0, 0, 0.2)
0044         Behavior on color {
0045                 enabled: highlightBackground
0046                 ColorAnimation {
0047                     duration: Kirigami.Units.longDuration
0048                     easing.type: Easing.OutCubic
0049                 }
0050             }
0051         Behavior on border.color {
0052             enabled: highlightBorder
0053             ColorAnimation {
0054                 duration: Kirigami.Units.longDuration
0055                 easing.type: Easing.OutCubic
0056             }
0057         }
0058         radius: 10
0059     }
0060     contentItem: Item{
0061         Kirigami.Icon{
0062             implicitHeight: Kirigami.Units.gridUnit * 1.2
0063             source: root.singleAction.icon.name
0064             anchors.centerIn: parent
0065         }
0066     }
0067     text: root.singleAction.text
0068     onClicked: root.singleAction.triggered()
0069 }