show add to favorites on clicking star

This commit is contained in:
Alexander Ivash 2018-04-27 20:54:35 +03:00
parent bd48ff9ee6
commit 4d2a37aff2

View file

@ -135,7 +135,6 @@ Rectangle {
Row { Row {
id: star id: star
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 119 anchors.topMargin: 119
anchors.left: avatarImage.right anchors.left: avatarImage.right
@ -153,21 +152,21 @@ Rectangle {
TextStyle5 { TextStyle5 {
text: isAvatarInFavorites ? avatarName : "Add to Favorites" text: isAvatarInFavorites ? avatarName : "Add to Favorites"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea { MouseArea {
enabled: !isAvatarInFavorites enabled: !isAvatarInFavorites
anchors.fill: parent anchors.fill: star
onClicked: { onClicked: {
console.debug('selectedAvatar.url', selectedAvatar.url) console.debug('selectedAvatar.url', selectedAvatar.url)
createFavorite.onSaveClicked = function() { createFavorite.onSaveClicked = function() {
selectedAvatar.favorite = true; selectedAvatar.favorite = true;
pageOfAvatars.setProperty(view.currentIndex, 'favorite', selectedAvatar.favorite) pageOfAvatars.setProperty(view.currentIndex, 'favorite', selectedAvatar.favorite)
createFavorite.close(); createFavorite.close();
}
createFavorite.open(selectedAvatar);
}
} }
createFavorite.open(selectedAvatar);
} }
} }