Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/ActionButton.qml
Show All 22 Lines | |||||
23 | 23 | | |||
24 | Item { | 24 | Item { | ||
25 | id: root | 25 | id: root | ||
26 | property alias text: label.text | 26 | property alias text: label.text | ||
27 | property alias iconSource: icon.source | 27 | property alias iconSource: icon.source | ||
28 | property alias containsMouse: mouseArea.containsMouse | 28 | property alias containsMouse: mouseArea.containsMouse | ||
29 | property alias font: label.font | 29 | property alias font: label.font | ||
30 | property alias labelRendering: label.renderType | 30 | property alias labelRendering: label.renderType | ||
31 | property alias circleOpacity: iconCircle.opacity | ||||
32 | property alias circleVisiblity: iconCircle.visible | ||||
31 | signal clicked | 33 | signal clicked | ||
32 | 34 | | |||
33 | activeFocusOnTab: true | 35 | activeFocusOnTab: true | ||
34 | 36 | | |||
35 | property int iconSize: units.gridUnit * 3 | 37 | property int iconSize: units.gridUnit * 3 | ||
36 | 38 | | |||
37 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | 39 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | ||
38 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | 40 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | ||
39 | 41 | | |||
42 | opacity: activeFocus || containsMouse ? 1 : 0.85 | ||||
43 | Behavior on opacity { | ||||
44 | PropertyAnimation { // OpacityAnimator makes it turn black at random intervals | ||||
davidedmundson: I ran with:
opacity: activeFocus || containsMouse ? 1 : 0.85
Behavior on opacity {… | |||||
45 | duration: units.longDuration * 2 | ||||
46 | easing.type: Easing.InOutQuad | ||||
47 | } | ||||
48 | } | ||||
49 | | ||||
50 | Rectangle { | ||||
51 | id: iconCircle | ||||
52 | anchors.centerIn: icon | ||||
53 | width: iconSize + units.smallSpacing | ||||
54 | height: width | ||||
55 | radius: width / 2 | ||||
davidedmundson: width/2 | |||||
56 | color: PlasmaCore.ColorScope.textColor | ||||
57 | opacity: activeFocus || containsMouse ? 0.15 : 0 | ||||
58 | Behavior on opacity { | ||||
59 | PropertyAnimation { // OpacityAnimator makes it turn black at random intervals | ||||
60 | duration: units.longDuration * 3 | ||||
61 | easing.type: Easing.InOutQuad | ||||
62 | } | ||||
63 | } | ||||
64 | } | ||||
65 | | ||||
40 | PlasmaCore.IconItem { | 66 | PlasmaCore.IconItem { | ||
41 | id: icon | 67 | id: icon | ||
42 | anchors { | 68 | anchors { | ||
43 | top: parent.top | 69 | top: parent.top | ||
44 | horizontalCenter: parent.horizontalCenter | 70 | horizontalCenter: parent.horizontalCenter | ||
45 | } | 71 | } | ||
46 | width: iconSize | 72 | width: iconSize | ||
47 | height: iconSize | 73 | height: iconSize | ||
Show All 35 Lines |
I ran with:
on my system, worked fine. Can you give any more details on "randomly"