on xenial help sign in
Add haptics to ScopesListCategoryItem buttons
commit9ed6b1e4d4efddb94af57f8e3b5b238c4fc885ab authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 9 Mar 2016, 15:14 (11 years ago) parentb2a1a5e
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