Warning, /maui/mauikit/src/style.5/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 
0024 import QtQuick 2.15
0025 import QtGraphicalEffects 1.15
0026 
0027 import QtQuick.Templates 2.15 as T
0028 import org.mauikit.controls 1.3 as Maui
0029 
0030 T.ToolBar 
0031 {
0032     id: control
0033     
0034     default property alias content : _layout.data
0035 
0036     Maui.Theme.colorSet: Maui.Theme.Header
0037     Maui.Theme.inherit: false
0038     
0039     property Item translucencySource : null
0040 
0041     implicitHeight: implicitContentHeight + topPadding + bottomPadding
0042     implicitWidth: implicitContentWidth + leftPadding + rightPadding
0043     
0044     contentWidth: contentChildren[0].implicitWidth
0045     contentHeight: contentChildren[0].implicitHeight
0046     
0047     padding: Maui.Style.defaultPadding
0048     spacing: Maui.Style.space.small
0049     
0050     font: Maui.Style.defaultFont
0051     
0052     property alias borderVisible: _border.visible
0053     
0054     contentItem: Row
0055     {
0056         id: _layout
0057         spacing: control.spacing
0058     }
0059     
0060     background: Rectangle
0061     {
0062         id: _headBarBG
0063         color: Maui.Theme.backgroundColor
0064 
0065         Behavior on color
0066         {
0067             Maui.ColorTransition{}
0068         }
0069         
0070         Loader
0071         {
0072             asynchronous: true
0073             active: control.translucencySource !== null && Maui.Style.enableEffects
0074             anchors.fill: parent
0075             sourceComponent: Item
0076             {
0077                 FastBlur
0078                 {
0079                     anchors.fill: parent
0080                     
0081                     layer.enabled: true
0082                     layer.effect: Desaturate
0083                     {
0084                         desaturation: -1.2
0085                     }
0086                     
0087                     source: control.translucencySource
0088                     radius: 64
0089                 }
0090                 
0091                 Rectangle
0092                 {
0093                     color: _headBarBG.color
0094                     anchors.fill: parent
0095                     opacity: 0.9
0096                     
0097                 }
0098             }
0099         }
0100         
0101         Maui.Separator
0102         {
0103             id: _border
0104             anchors.left: parent.left
0105             anchors.right: parent.right
0106             weight: Maui.Separator.Weight.Light
0107             opacity: 0.4
0108 
0109             Behavior on color
0110             {
0111                 Maui.ColorTransition{}
0112             }
0113         }
0114 
0115         states: [  State
0116             {
0117                 when: control.position === ToolBar.Header
0118 
0119                 AnchorChanges
0120                 {
0121                     target: _border
0122                     anchors.top: undefined
0123                     anchors.bottom: parent.bottom
0124                 }
0125             },
0126 
0127             State
0128             {
0129                 when: control.position === ToolBar.Footer
0130 
0131                 AnchorChanges
0132                 {
0133                     target: _border
0134                     anchors.top: parent.top
0135                     anchors.bottom: undefined
0136                 }
0137             }
0138         ]
0139     }
0140 }