Warning, /plasma/plasma-mobile/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.1
0008 import QtQuick.Layouts 1.1
0009 
0010 import org.kde.kirigami 2.12 as Kirigami
0011 
0012 import org.kde.plasma.private.mobileshell as MobileShell
0013 import org.kde.plasma.core as PlasmaCore
0014 import org.kde.plasma.private.nanoshell 2.0 as NanoShell
0015 import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
0016 import org.kde.plasma.components 3.0 as PlasmaComponents
0017 
0018 QuickSettingsDelegate {
0019     id: root
0020 
0021     iconItem: icon
0022     
0023     // scale animation on press
0024     zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
0025     
0026     background: Item {
0027         // very simple shadow for performance
0028         Rectangle {
0029             anchors.top: parent.top
0030             anchors.topMargin: 1
0031             anchors.left: parent.left
0032             anchors.right: parent.right
0033             height: parent.height
0034             
0035             radius: Kirigami.Units.smallSpacing
0036             color: Qt.rgba(0, 0, 0, 0.075)
0037         }
0038         
0039         // background
0040         Rectangle {
0041             anchors.fill: parent
0042             radius: Kirigami.Units.smallSpacing
0043             border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor
0044             color: {
0045                 if (root.enabled) {
0046                     return mouseArea.pressed ? root.enabledButtonPressedColor : root.enabledButtonColor
0047                 } else {
0048                     return mouseArea.pressed ? root.disabledButtonPressedColor : root.disabledButtonColor
0049                 }
0050             }
0051         }
0052     }
0053     
0054     MobileShell.HapticsEffect {
0055         id: haptics
0056     }
0057     
0058     contentItem: MouseArea {
0059         id: mouseArea
0060         
0061         onPressed: haptics.buttonVibrate();
0062         onClicked: root.delegateClick()
0063         onPressAndHold: {
0064             haptics.buttonVibrate();
0065             root.delegatePressAndHold();
0066         }
0067         
0068         cursorShape: Qt.PointingHandCursor
0069         
0070         Kirigami.Icon {
0071             id: icon
0072             anchors.centerIn: parent
0073             implicitWidth: Kirigami.Units.iconSizes.smallMedium
0074             implicitHeight: width
0075             source: root.icon
0076         }
0077     }
0078 }
0079