Warning, /maui/nomad-style/ToolBar.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.2
0025 import QtQuick.Templates 2.3 as T
0026 import org.kde.kirigami 2.2 as Kirigami
0027 
0028 T.ToolBar {
0029     id: controlRoot
0030 
0031     implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
0032     implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
0033 
0034 //     leftPadding: Kirigami.Units.smallSpacing*2
0035 //     rightPadding: Kirigami.Units.smallSpacing*2
0036     
0037     contentWidth: contentChildren[0].implicitWidth
0038     contentHeight: contentChildren[0].implicitHeight
0039 
0040     contentItem: Item {}
0041 
0042     readonly property bool mainHeader : controlRoot == T.ApplicationWindow.header
0043     readonly property bool mainFooter : controlRoot == T.ApplicationWindow.footer
0044     readonly property bool isFooter : controlRoot.position == T.ToolBar.Footer
0045     readonly property bool isHeader : controlRoot.position == T.ToolBar.Header
0046     
0047     background: Rectangle 
0048     {
0049         implicitHeight: Kirigami.Units.iconSizes.medium + (Kirigami.Settings.isMobile ?  Kirigami.Units.smallSpacing : Kirigami.Units.largeSpacing)
0050         
0051 //         color: mainHeader || mainFooter ? Kirigami.Theme.buttonBackgroundColor :   Kirigami.Theme.viewBackgroundColor
0052         color: Kirigami.Theme.viewBackgroundColor
0053         
0054         Kirigami.Separator 
0055         {
0056             visible: mainHeader
0057             color: Qt.darker(Kirigami.Theme.backgroundColor, 1.2)
0058             anchors 
0059             {
0060                 left: parent.left
0061                 right: parent.right
0062                 top: mainHeader && !Kirigami.Settings.isMobile ? parent.top : undefined
0063             }
0064         }  
0065         
0066          Kirigami.Separator 
0067         {
0068                         color: Qt.darker(Kirigami.Theme.backgroundColor, 1.2)
0069 
0070             anchors 
0071             {
0072                 left: parent.left
0073                 right: parent.right
0074                 bottom: !isFooter ? parent.bottom : undefined
0075             }
0076         }
0077        
0078     }
0079 }