Warning, /maui/nomad-style/Drawer.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.Controls 2.3
0025 import QtQuick.Templates 2.3 as T
0026 import org.kde.kirigami 2.2 as Kirigami
0027 
0028 T.Drawer {
0029     id: control
0030 
0031     parent: T.ApplicationWindow.overlay
0032 
0033     implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
0034     implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
0035 
0036     contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
0037     contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
0038 
0039     topPadding: control.edge === Qt.BottomEdge ? 1 : 0
0040     leftPadding: control.edge === Qt.RightEdge ? 1 : 0
0041     rightPadding: control.edge === Qt.LeftEdge ? 1 : 0
0042     bottomPadding: control.edge === Qt.TopEdge ? 1 : 0
0043 
0044     background: Rectangle 
0045     {
0046         color: Kirigami.Theme.viewBackgroundColor
0047          Kirigami.Separator 
0048         {
0049             anchors 
0050             {
0051                 left: control.edge === Qt.RightEdge ?  parent.left : undefined
0052                 right: control.edge === Qt.LeftEdge ? parent.right : undefined
0053                 top: parent.top
0054                 bottom: parent.bottom
0055             }
0056         }  
0057     }
0058 
0059     enter: Transition {
0060         SmoothedAnimation {
0061             velocity: 5
0062         }
0063     }
0064     exit: Transition {
0065         SmoothedAnimation {
0066             velocity: 5
0067         }
0068     }
0069 }