on xenial help sign in
Add haptics to ScopesListCategoryItem buttons
c74c788Albert Astals Cid
qml/Dash/ScopesListCategoryItem.qml+8−4
@@ -18,7 +18,7 @@ import QtQuick 2.4
18import QtQuick.Layouts 1.1
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
20
20
21−MouseArea {
21+AbstractButton {
22 id: root
22 id: root
23
23
24 signal requestFavorite(string scopeId, bool favorite)
24 signal requestFavorite(string scopeId, bool favorite)
@@ -84,15 +84,19 @@ MouseArea {
84 visible: text != ""
84 visible: text != ""
85 }
85 }
86 }
86 }
87− MouseArea {
87+ AbstractButton {
88 id: starArea
88 id: starArea
89 objectName: "starArea"
89 objectName: "starArea"
90 height: parent.height
90 height: parent.height
91 width: height
91 width: height
92 anchors.right: parent.right
92 anchors.right: parent.right
93 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
93 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
94+ onPressedChanged: {
95+ if (editMode) {
94− onPressed: if (editMode) root.handlePressed(starArea);
96+ if (pressed) root.handlePressed(starArea.__mouseArea);
95− onReleased: if (editMode) root.handleReleased(starArea);
97+ else root.handleReleased(starArea.__mouseArea);
98+ }
99+ }
96 visible: editMode || showStar
100 visible: editMode || showStar
97 Icon {
101 Icon {
98 id: star
102 id: star