Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/ActionButton.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.2 | 20 | import QtQuick 2.2 | ||
21 | import QtGraphicalEffects 1.0 | ||||
21 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
22 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||||
23 | 25 | | |||
24 | Item { | 26 | Item { | ||
25 | id: root | 27 | id: root | ||
26 | property alias text: label.text | 28 | property alias text: label.text | ||
27 | property alias iconSource: icon.source | 29 | property alias iconSource: icon.source | ||
28 | property alias containsMouse: mouseArea.containsMouse | 30 | property alias containsMouse: mouseArea.containsMouse | ||
29 | property alias font: label.font | 31 | property alias font: label.font | ||
32 | property alias labelShadow: labelShadow.visible | ||||
30 | signal clicked | 33 | signal clicked | ||
31 | 34 | | |||
32 | activeFocusOnTab: true | 35 | activeFocusOnTab: true | ||
33 | 36 | | |||
34 | property int iconSize: units.gridUnit * 3 | 37 | property int iconSize: units.gridUnit * 3 | ||
35 | 38 | | |||
36 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | 39 | implicitWidth: Math.max(iconSize + units.largeSpacing * 3, label.contentWidth) | ||
37 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | 40 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | ||
38 | 41 | | |||
39 | PlasmaCore.IconItem { | 42 | PlasmaCore.IconItem { | ||
40 | id: icon | 43 | id: icon | ||
41 | anchors { | 44 | anchors { | ||
42 | top: parent.top | 45 | top: parent.top | ||
43 | horizontalCenter: parent.horizontalCenter | 46 | horizontalCenter: parent.horizontalCenter | ||
44 | } | 47 | } | ||
45 | width: iconSize | 48 | width: iconSize | ||
46 | height: iconSize | 49 | height: iconSize | ||
47 | 50 | | |||
48 | colorGroup: PlasmaCore.ColorScope.colorGroup | 51 | colorGroup: PlasmaCore.ColorScope.colorGroup | ||
49 | active: mouseArea.containsMouse || root.activeFocus | 52 | active: mouseArea.containsMouse || root.activeFocus | ||
50 | } | 53 | } | ||
51 | PlasmaComponents.Label { | 54 | | ||
55 | DropShadow { | ||||
56 | id: labelShadow | ||||
57 | visible: false | ||||
58 | anchors.fill: label | ||||
59 | source: label | ||||
60 | horizontalOffset: 0 | ||||
61 | verticalOffset: 1 | ||||
62 | radius: 12 | ||||
63 | samples: 32 | ||||
64 | spread: 0.2 | ||||
65 | color: "#232629" // Breeze Shade Black | ||||
66 | } | ||||
67 | PlasmaExtras.Heading { | ||||
52 | id: label | 68 | id: label | ||
53 | anchors { | 69 | anchors { | ||
54 | top: icon.bottom | 70 | top: icon.bottom | ||
55 | topMargin: units.smallSpacing | 71 | topMargin: units.smallSpacing | ||
56 | left: parent.left | 72 | left: parent.left | ||
57 | right: parent.right | 73 | right: parent.right | ||
58 | } | 74 | } | ||
59 | horizontalAlignment: Text.AlignHCenter | 75 | horizontalAlignment: Text.AlignHCenter | ||
60 | verticalAlignment: Text.AlignTop | 76 | verticalAlignment: Text.AlignTop | ||
61 | wrapMode: Text.WordWrap | 77 | wrapMode: Text.WordWrap | ||
78 | level: 4 | ||||
62 | font.underline: root.activeFocus | 79 | font.underline: root.activeFocus | ||
80 | style: Text.Outline | ||||
81 | styleColor: "#232629" // Breeze Shade Black | ||||
63 | } | 82 | } | ||
64 | 83 | | |||
65 | MouseArea { | 84 | MouseArea { | ||
66 | id: mouseArea | 85 | id: mouseArea | ||
67 | hoverEnabled: true | 86 | hoverEnabled: true | ||
68 | onClicked: root.clicked() | 87 | onClicked: root.clicked() | ||
69 | anchors.fill: parent | 88 | anchors.fill: parent | ||
70 | } | 89 | } | ||
Show All 9 Lines |