Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/ActionButton.qml
Show All 38 Lines | 24 | Item { | |||
---|---|---|---|---|---|
39 | property int iconSize: units.gridUnit * 3 | 39 | property int iconSize: units.gridUnit * 3 | ||
40 | 40 | | |||
41 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | 41 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | ||
42 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | 42 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | ||
43 | 43 | | |||
44 | opacity: activeFocus || containsMouse ? 1 : 0.85 | 44 | opacity: activeFocus || containsMouse ? 1 : 0.85 | ||
45 | Behavior on opacity { | 45 | Behavior on opacity { | ||
46 | PropertyAnimation { // OpacityAnimator makes it turn black at random intervals | 46 | PropertyAnimation { // OpacityAnimator makes it turn black at random intervals | ||
47 | duration: units.longDuration * 2 | 47 | duration: units.longDuration | ||
48 | easing.type: Easing.InOutQuad | 48 | easing.type: Easing.InOutQuad | ||
49 | } | 49 | } | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | Rectangle { | 52 | Rectangle { | ||
53 | id: iconCircle | 53 | id: iconCircle | ||
54 | anchors.centerIn: icon | 54 | anchors.centerIn: icon | ||
55 | width: iconSize + units.smallSpacing | 55 | width: iconSize + units.smallSpacing | ||
56 | height: width | 56 | height: width | ||
57 | radius: width / 2 | 57 | radius: width / 2 | ||
58 | color: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : PlasmaCore.ColorScope.textColor | 58 | color: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : PlasmaCore.ColorScope.textColor | ||
59 | opacity: activeFocus || containsMouse ? (softwareRendering ? 0.8 : 0.15) : (softwareRendering ? 0.6 : 0) | 59 | opacity: activeFocus || containsMouse ? (softwareRendering ? 0.8 : 0.15) : (softwareRendering ? 0.6 : 0) | ||
60 | Behavior on opacity { | 60 | Behavior on opacity { | ||
61 | PropertyAnimation { // OpacityAnimator makes it turn black at random intervals | 61 | PropertyAnimation { // OpacityAnimator makes it turn black at random intervals | ||
62 | duration: units.longDuration * 3 | 62 | duration: units.longDuration | ||
63 | easing.type: Easing.InOutQuad | 63 | easing.type: Easing.InOutQuad | ||
64 | } | 64 | } | ||
65 | } | 65 | } | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | Rectangle { | 68 | Rectangle { | ||
69 | anchors.centerIn: iconCircle | 69 | anchors.centerIn: iconCircle | ||
70 | width: iconCircle.width | 70 | width: iconCircle.width | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |