Warning, /plasma/plasma-sdk/themeexplorer/package/contents/ui/fakecontrols/Button.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.3
0008 import Qt5Compat.GraphicalEffects
0009 import QtQuick.Controls 2.15
0010 
0011 Item {
0012     implicitWidth: parent.width/1.2
0013     implicitHeight: units.gridUnit * 1.6
0014 
0015     Rectangle {
0016         id: button
0017         anchors.fill: parent
0018         radius: units.smallSpacing/2
0019         color: buttonMouse.pressed ? Qt.darker(buttonBackgroundColor, 1.5) : buttonBackgroundColor
0020         Label {
0021             anchors.centerIn: parent
0022             text: i18n("Button")
0023             color: buttonTextColor
0024         }
0025         MouseArea {
0026             id: buttonMouse
0027             anchors.fill: parent
0028             hoverEnabled: true
0029             onClicked: button.focus = true
0030         }
0031         Rectangle {
0032             anchors.fill: parent
0033             radius: units.smallSpacing/2
0034             visible: buttonMouse.containsMouse || button.focus
0035             color: "transparent"
0036             border {
0037                 color: buttonMouse.containsMouse ? buttonHoverColor : buttonFocusColor
0038             }
0039         }
0040     }
0041     DropShadow {
0042         anchors.fill: button
0043         horizontalOffset: 0
0044         verticalOffset: units.smallSpacing/4
0045         radius: units.smallSpacing 
0046         samples: 16
0047         color: buttonMouse.pressed ? Qt.rgba(0, 0, 0, 0) : Qt.rgba(0, 0, 0, 0.5)
0048         source: button
0049     }
0050 }