Warning, /maui/paleta/src/controls/ColorButton.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.15
0002 import QtQml 2.15
0003 import QtQuick.Controls 2.15
0004 import QtQuick.Layouts 1.12
0005 
0006 import org.mauikit.controls 1.3 as Maui
0007 
0008 AbstractButton
0009 {
0010     id: control
0011     Maui.Theme.colorSet: Maui.Theme.Button
0012     Maui.Theme.inherit: false
0013 
0014     property color color : Maui.Theme.backgroundColor
0015 spacing: Maui.Style.space.medium
0016     implicitHeight: implicitContentHeight + topPadding + bottomPadding
0017     implicitWidth: 100 + leftPadding + rightPadding
0018 
0019     font.pointSize: Maui.Style.fontSizes.small
0020 padding: Maui.Style.space.medium
0021 hoverEnabled: true
0022 
0023     background: Rectangle
0024     {
0025         radius: Maui.Style.radiusV
0026         color: control.down || control.pressed ? Maui.Theme.focusColor : control.hovered ? Maui.Theme.hoverColor : Maui.Theme.alternateBackgroundColor
0027     }
0028 
0029     contentItem: Column
0030     {
0031         spacing: control.spacing
0032         Rectangle
0033         {
0034             height: 32
0035             width: height
0036             radius: height/2
0037             color: control.color
0038             border.width: 3
0039             border.color: Maui.ColorUtils.brightnessForColor(control.color) === Maui.ColorUtils.Dark ? Qt.lighter(control.color) : Qt.darker(control.color)
0040 
0041         }
0042 
0043         Label
0044         {
0045             width: parent.width
0046             text: control.text
0047             font: control.font
0048             wrapMode: Text.Wrap
0049         }
0050     }
0051 
0052 }