@@ -19,12 +19,11 @@ import Ubuntu.Components 1.3
1919
2020Rectangle {
2121 id: root
22−
2322 height: units.gu(4)
2423 radius: units.gu(0.6)
2524
2625 // to be read from outside
27− readonly property bool containsMouse: button.__mouseArea.containsMouse
26+ readonly property alias containsMouse: mouseArea.containsMouse
2827
2928 // to be set from outside
3029 property bool outline: true
@@ -34,33 +33,36 @@ Rectangle {
3433
3534 signal clicked()
3635
37− AbstractButton {
38− id: button
39− anchors.fill: root
40− __mouseArea.hoverEnabled: root.hoverEnabled
41− onClicked: root.clicked()
36+ Label {
37+ id: label
38+ fontSize: "medium"
39+ font.weight: Font.Light
40+ anchors.centerIn: root
41+ color: outline ? theme.palette.normal.backgroundSecondaryText : "white"
42+ visible: text !== ""
43+ }
4244
43− Label {
44− id: label
45− fontSize: "medium"
46− font.weight: Font.Light
47− anchors.centerIn: parent
48− color: outline ? theme.palette.normal.backgroundSecondaryText : "white"
49− visible: text !== ""
50− }
45+ Icon {
46+ id: icon
47+ height: root.height * 2 / 3
48+ width: height
49+ anchors.centerIn: root
50+ color: "white"
51+ visible: !label.visible
52+ }
5153
52− Icon {
53− id: icon
54− height: root.height * 2 / 3
55− width: height
56− anchors.centerIn: parent
57− color: "white"
58− visible: !label.visible
54+ MouseArea {
55+ id: mouseArea
56+ anchors.fill: root
57+ hoverEnabled: root.hoverEnabled
58+ onClicked: {
59+ Haptics.play();
60+ root.clicked();
5961 }
6062 }
6163
6264 transformOrigin: Item.Top
63− scale: button.pressed ? 0.98 : 1.0
65+ scale: mouseArea.pressed ? 0.98 : 1.0
6466 Behavior on scale {
6567 ScaleAnimator {
6668 duration: UbuntuAnimation.SnapDuration