@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2013 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -16,11 +16,26 @@
1616
1717import QtQuick 2.0
1818
19−// FIXME this goes away when new scopes go in: compatibility layer with old RatingStars widget
20−
21−Rating {
19+Row {
2220 id: root
23− property alias rating: root.value
24− property alias maximumRating: root.maximumValue
25− property alias starCount: root.size
21+ property int rating
22+ property int maximumRating: 5
23+ property int starCount: 5
24+ height: childrenRect.height
25+ width: childrenRect.width
26+
27+ readonly property int effectiveRating: Math.max(0, Math.min(root.starCount * root.rating / root.maximumRating, root.maximumRating))
28+
29+ Repeater {
30+ model: root.effectiveRating
31+ Image {
32+ source: "graphics/icon_star_on.png"
33+ }
34+ }
35+ Repeater {
36+ model: root.starCount - root.effectiveRating
37+ Image {
38+ source: "graphics/icon_star_off.png"
39+ }
40+ }
2641}