Warning, /maui/mauikit/src/controls.5/MenuItemActionRow.qml is written in an unsupported language. File is not indexed.

0001 // Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
0002 // Copyright 2018-2020 Nitrux Latinoamericana S.C.
0003 //
0004 // SPDX-License-Identifier: GPL-3.0-or-later
0005 
0006 import QtQuick 2.15
0007 import QtQuick.Controls 2.15
0008 import QtQuick.Layouts 1.3
0009 
0010 import org.mauikit.controls 1.3 as Maui
0011 import QtQuick.Templates 2.15 as T
0012 
0013 T.MenuItem
0014 {
0015     id: control
0016     default property list<Action> actions
0017     
0018     opacity: control.enabled ? 1 : 0.5
0019     
0020     hoverEnabled: !Maui.Handy.isMobile
0021     
0022     implicitHeight: implicitContentHeight + topPadding + bottomPadding
0023     implicitWidth: ListView.view ? ListView.view.width : Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
0024     
0025     background: null
0026     
0027     padding: 0
0028     spacing: Maui.Style.space.small   
0029     font: Maui.Style.defaultFont
0030         
0031     display : width > Maui.Style.units.gridUnit * 28 && control.actions.length <= 3 ?  ToolButton.TextBesideIcon : (Maui.Handy.isMobile ? ToolButton.TextUnderIcon : ToolButton.IconOnly)
0032     
0033     contentItem: Flow
0034     {
0035         id: _layout
0036         //            anchors.centerIn: parent
0037         spacing: control.spacing
0038         
0039         Repeater
0040         {
0041             id: _repeater
0042             model: control.actions
0043             
0044             delegate: ToolButton
0045             {
0046                 id: _delegate
0047                 Maui.Theme.inherit: true
0048                 
0049                 action: modelData
0050                 display: control.display
0051                 
0052                 ToolTip.delay: 1000
0053                 ToolTip.timeout: 5000
0054                 ToolTip.visible: ( _delegate.hovered ) && _delegate.text.length
0055                 ToolTip.text: modelData.text
0056                 
0057                 background: Rectangle
0058                 {
0059                     radius: Maui.Style.radiusV
0060                     color: _delegate.checked || _delegate.pressed || _delegate.down ? Maui.Theme.highlightColor : _delegate.highlighted || _delegate.hovered ? Maui.Theme.hoverColor : Maui.Theme.alternateBackgroundColor
0061                     
0062                 }
0063                 
0064                 Connections
0065                 {
0066                     target: _delegate.action
0067                     ignoreUnknownSignals: true
0068                     function onTriggered()
0069                     {
0070                         control.triggered()
0071                     }
0072                 }
0073             }
0074         }
0075     }
0076     
0077 }