5import QGroundControl.Controls
7/// Square icon-only button sized for touch
11 property string iconSource
12 property real iconRotation: 0
13 property bool danger: false
14 property string accessibleName ///< Translated action name read by assistive technology
16 Accessible.name: accessibleName
18 implicitWidth: implicitHeight
19 implicitHeight: ScreenTools.isMobile ? ScreenTools.minTouchPixels : ScreenTools.implicitButtonHeight
20 padding: ScreenTools.defaultFontPixelHeight * 0.35
21 hoverEnabled: !ScreenTools.isMobile
22 focusPolicy: Qt.ClickFocus
24 QGCPalette { id: qgcPal; colorGroupEnabled: control.enabled }
26 background: Rectangle {
27 radius: ScreenTools.defaultBorderRadius
28 color: control.pressed ? qgcPal.accentSubtle : qgcPal.windowCard
29 border.color: control.hovered || control.pressed ? qgcPal.accent : qgcPal.borderSubtle
32 contentItem: QGCColoredImage {
33 source: control.iconSource
34 rotation: control.iconRotation
35 color: control.danger ? qgcPal.colorRed : qgcPal.textPrimary
36 fillMode: Image.PreserveAspectFit
37 sourceSize.height: height