: 12 spacing: 6 icon.width: 24 icon.height: 24 icon.color: !enabled ? Material.hintTextColor : flat && highlighted ? Material.accentColor : highlighted ? Material.primaryHighlightedTextColor : Material.foreground Material.elevation: flat ? control.down || control.hovered ? 2 : 0 : control.down ? 12 : 6 Material.background: flat ? "transparent" : undefined contentItem: IconLabel { spacing: control.spacing mirrored: control.mirrored display: control.display icon: control.icon text: control.text font: control.font color: !control.enabled ? control.Material.hintTextColor : control.flat && control.highlighted ? control.Material.accentColor : control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.foreground } // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { implicitWidth: control.Material.buttonHeight implicitHeight: control.Material.buttonHeight radius: control.radius color: !control.enabled ? control.Material.buttonDisabledColor : control.checked || control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor Rectangle { width: parent.width height: parent.height radius: control.radius visible: enabled && (control.hovered || control.visualFocus) color: control.Material.rippleColor } Rectangle { width: parent.width height: parent.height radius: control.radius visible: control.down color: control.Material.rippleColor } // The layer is disabled when the button color is transparent so that you can do // Material.background: "transparent" and get a proper flat button without needing // to set Material.elevation as well layer.enabled: control.enabled && control.Material.buttonColor.a > 0 layer.effect: ElevationEffect { elevation: control.Material.elevation } } }