Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/PrivateActionToolButton.qml
Show All 36 Lines | 25 | Controls.ToolButton { | |||
---|---|---|---|---|---|
37 | Theme.backgroundColor: kirigamiAction && kirigamiAction.icon.color.a ? kirigamiAction.icon.color : undefined | 37 | Theme.backgroundColor: kirigamiAction && kirigamiAction.icon.color.a ? kirigamiAction.icon.color : undefined | ||
38 | Theme.textColor: kirigamiAction && !flat && kirigamiAction.icon.color.a ? Theme.highlightedTextColor : undefined | 38 | Theme.textColor: kirigamiAction && !flat && kirigamiAction.icon.color.a ? Theme.highlightedTextColor : undefined | ||
39 | 39 | | |||
40 | hoverEnabled: true | 40 | hoverEnabled: true | ||
41 | flat: !control.kirigamiAction || !control.kirigamiAction.icon.color.a | 41 | flat: !control.kirigamiAction || !control.kirigamiAction.icon.color.a | ||
42 | //TODO: replace with upstream action when we depend on Qt 5.10 | 42 | //TODO: replace with upstream action when we depend on Qt 5.10 | ||
43 | //TODO: upstream action makes the style to re-draw the content, it'd be ideal except for the custom dropDown icon needed for actionsMenu | 43 | //TODO: upstream action makes the style to re-draw the content, it'd be ideal except for the custom dropDown icon needed for actionsMenu | ||
44 | property Controls.Action kirigamiAction | 44 | property Controls.Action kirigamiAction | ||
45 | property bool showText: true | 45 | property bool showText: !(kirigamiAction && kirigamiAction.displayHint !== undefined | ||
46 | property bool showMenuArrow: true | 46 | && kirigamiAction.displayHintSet(Action.DisplayHint.IconOnly)) | ||
47 | property bool showMenuArrow: !(kirigamiAction && kirigamiAction.displayHint !== undefined | ||||
48 | && kirigamiAction.displayHintSet(Action.DisplayHint.HideChildIndicator)) | ||||
47 | property alias menu: menu | 49 | property alias menu: menu | ||
48 | 50 | | |||
49 | //we need our own text delegate | 51 | //we need our own text delegate | ||
50 | text: "" | 52 | text: "" | ||
51 | checkable: (kirigamiAction && kirigamiAction.checkable) || (menu.actions && menu.actions.length > 0) | 53 | checkable: (kirigamiAction && kirigamiAction.checkable) || (menu.actions && menu.actions.length > 0) | ||
52 | checked: (kirigamiAction && kirigamiAction.checked) | 54 | checked: (kirigamiAction && kirigamiAction.checked) | ||
53 | enabled: kirigamiAction && kirigamiAction.enabled | 55 | enabled: kirigamiAction && kirigamiAction.enabled | ||
54 | opacity: enabled ? 1 : 0.4 | 56 | opacity: enabled ? 1 : 0.4 | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |