Warning, /maui/nomad-style/Menu.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.Layouts 1.2
0025 import QtGraphicalEffects 1.0
0026 import QtQuick.Controls 2.3
0027 import QtQuick.Templates 2.3 as T
0028 import org.kde.kirigami 2.2 as Kirigami
0029 
0030 T.Menu {
0031     id: control
0032 
0033     implicitWidth: Math.max(background ? background.implicitWidth : 0,
0034                             contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
0035     implicitHeight: Math.max(background ? background.implicitHeight : 0,
0036                              contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding
0037 
0038     margins: 0
0039 
0040     contentItem: ColumnLayout {}
0041 
0042     enter: Transition {
0043         NumberAnimation {
0044             property: "opacity"
0045             from: 0
0046             to: 1
0047             easing.type: Easing.InOutQuad
0048             duration: 150
0049         }
0050     }
0051 
0052     exit: Transition {
0053         NumberAnimation {
0054             property: "opacity"
0055             from: 1
0056             to: 0
0057             easing.type: Easing.InOutQuad
0058             duration: 150
0059         }
0060     }
0061 
0062     background: Rectangle {
0063         radius: height * 0.005
0064         implicitWidth: Kirigami.Units.gridUnit * 8
0065         implicitHeight: 40
0066         color: Kirigami.Theme.backgroundColor
0067         property color borderColor: Kirigami.Theme.textColor
0068         border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3)
0069         layer.enabled: true
0070         
0071         layer.effect: DropShadow {
0072             transparentBorder: true
0073             radius: 4
0074             samples: 8
0075             horizontalOffset: 2
0076             verticalOffset: 2
0077             color: Qt.rgba(0, 0, 0, 0.3)
0078         }
0079     }
0080 }