2
import StyleItemType 0.1
3
import TooltipAreaType 0.1
4
import "private" as Private
8
property alias containsMouse: tooltip.containsMouse
9
property string iconName
10
property string styleHint
11
property int iconSize: (backgroundItem && backgroundItem.style === "mac" && button.styleHint.indexOf("segmented") !== -1) ? 16 : 24
13
implicitWidth: backgroundItem.implicitWidth
14
implicitHeight: backgroundItem.implicitHeight
17
// Note this will eat hover events
23
background: StyleItem {
26
elementType: "toolbutton"
32
hint: button.styleHint
33
contentWidth: Math.max(textitem.paintedWidth, 32)
38
anchors.centerIn: parent
39
visible: button.iconSource == ""
44
anchors.centerIn: parent
45
opacity: enabled ? 1 : 0.5
47
sourceSize.width: iconSize
48
property string iconPath: "image://desktoptheme/" + button.iconName
49
source: backgroundItem && backgroundItem.hasThemeIcon(iconName) ? iconPath : ""
50
fillMode: Image.PreserveAspectFit
53
anchors.centerIn: parent
54
sourceSize: parent.sourceSize
55
visible: (themeIcon.status != Image.Ready)
56
source: visible ? button.iconSource : ""