added rating support to comics grid view

This commit is contained in:
Luis Ángel San Martín
2014-10-13 12:03:33 +02:00
parent 964bb377ce
commit 5e355f85bf
5 changed files with 36 additions and 3 deletions

View File

@ -77,7 +77,6 @@ Rectangle {
comicsSelectionHelper.selectIndex(index)
grid.currentIndex = index;
}
}
@ -187,7 +186,30 @@ Rectangle {
id: ratingImage
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
source: "star.png"
MouseArea {
anchors.fill: parent
onClicked: {
console.log("rating");
comicsSelectionHelper.clear();
comicsSelectionHelper.selectIndex(index);
grid.currentIndex = index;
ratingConextMenu.popup();
}
}
Menu {
id: ratingConextMenu
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
}
}
//comic rating
Text {
id: comicRating

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B