on xenial help sign in
Add haptics to ScopesListCategoryItem buttons

Approved by: Josh Arenson

commitc74c7888b29c8119b7e82a6505af12a69f33c40e authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 10 Mar 2016, 22:43 (11 years ago) parentf9099ff9ed6b1e
1 file changed+8−4
qml/Dash/ScopesListCategoryItem.qml+8−4
qml/Dash/ScopesListCategoryItem.qml+8−4
@@ -18,7 +18,7 @@ import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import Ubuntu.Components 1.3
2020
21−MouseArea {
21+AbstractButton {
2222 id: root
2323
2424 signal requestFavorite(string scopeId, bool favorite)
@@ -84,15 +84,19 @@ MouseArea {
8484 visible: text != ""
8585 }
8686 }
87− MouseArea {
87+ AbstractButton {
8888 id: starArea
8989 objectName: "starArea"
9090 height: parent.height
9191 width: height
9292 anchors.right: parent.right
9393 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
94− onPressed: if (editMode) root.handlePressed(starArea);
95− onReleased: if (editMode) root.handleReleased(starArea);
94+ onPressedChanged: {
95+ if (editMode) {
96+ if (pressed) root.handlePressed(starArea.__mouseArea);
97+ else root.handleReleased(starArea.__mouseArea);
98+ }
99+ }
96100 visible: editMode || showStar
97101 Icon {
98102 id: star