Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/ActionButton.qml
Show All 21 Lines | |||||
22 | import org.kde.plasma.components 2.0 as PlasmaComponents | 22 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
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 circleOpacity: iconCircle.opacity | ||||
31 | property alias labelAnchors: label.anchors | ||||
30 | signal clicked | 32 | signal clicked | ||
31 | 33 | | |||
32 | activeFocusOnTab: true | 34 | activeFocusOnTab: true | ||
33 | 35 | | |||
34 | property int iconSize: units.gridUnit * 3 | 36 | property int iconSize: units.gridUnit * 3 | ||
35 | 37 | | |||
36 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | 38 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | ||
37 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | 39 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | ||
38 | 40 | | |||
41 | opacity: activeFocus || containsMouse ? 1 : 0.85 | ||||
42 | Behavior on opacity { | ||||
43 | OpacityAnimator { | ||||
davidedmundson: I ran with:
opacity: activeFocus || containsMouse ? 1 : 0.85
Behavior on opacity {… | |||||
44 | duration: units.longDuration * 2 | ||||
45 | easing.type: Easing.InOutQuad | ||||
46 | } | ||||
47 | } | ||||
48 | | ||||
49 | Rectangle { | ||||
50 | id: iconCircle | ||||
51 | anchors.centerIn: icon | ||||
52 | width: iconSize + units.smallSpacing | ||||
53 | height: width | ||||
54 | radius: width | ||||
davidedmundson: width/2 | |||||
55 | color: PlasmaCore.ColorScope.textColor | ||||
56 | opacity: activeFocus || containsMouse ? 0.15 : 0 | ||||
57 | Behavior on opacity { | ||||
58 | OpacityAnimator { | ||||
59 | duration: units.longDuration * 3 | ||||
60 | easing.type: Easing.InOutQuad | ||||
61 | } | ||||
62 | } | ||||
63 | } | ||||
64 | | ||||
39 | PlasmaCore.IconItem { | 65 | PlasmaCore.IconItem { | ||
40 | id: icon | 66 | id: icon | ||
41 | anchors { | 67 | anchors { | ||
42 | top: parent.top | 68 | top: parent.top | ||
43 | horizontalCenter: parent.horizontalCenter | 69 | horizontalCenter: parent.horizontalCenter | ||
44 | } | 70 | } | ||
45 | width: iconSize | 71 | width: iconSize | ||
46 | height: iconSize | 72 | height: iconSize | ||
Show All 35 Lines |
I ran with:
on my system, worked fine. Can you give any more details on "randomly"