Move the rating logic outside of the rating widget

That way it's easier to re-use the component if that's ever required.

CURA-6013
This commit is contained in:
Jaime van Kessel 2018-12-10 10:40:54 +01:00
parent 04f3601c27
commit 098adc45ff
2 changed files with 20 additions and 2 deletions

View file

@ -19,6 +19,8 @@ Item
property int userRating: 0
signal rated(int rating)
width: contentRow.width
height: contentRow.height
MouseArea
@ -94,8 +96,9 @@ Item
onClicked:
{
// Ensure that the local rating is updated (even though it's not on the server just yet)
_localRating = index + 1
toolbox.ratePackage(ratingWidget.packageId, index + 1)
//_localRating = index + 1
rated(index + 1)
}
}
}