Skip to content
Browse files

Added image and remove text next to stars

  • Loading branch information...
1 parent 6a1e3a7 commit 092d494171dc4255f1c0c23d6269075589dca2ce @flatzo committed May 1, 2012
Showing with 21 additions and 34 deletions.
  1. BIN src/star.png
  2. +21 −34 src/widget.js
View
BIN src/star.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
55 src/widget.js
@@ -191,43 +191,30 @@ function TrackRating() {
TrackRating.prototype = {
_init: function(prepend, value, style, icon_path) {
this.box = new St.Table({style_class: style});
- this._label = new St.Label();
-this._starImage = new Array();
-this._starTexture = new Array();
-this._starButton = new Array();
-this._star = new Array();
-for(i=0; i < 5; i++) {
- this._starImage[i] = new St.Bin({style_class: 'track-rating'});
- this._starTexture[i] = new Clutter.Texture({filter_quality: 2, filename: icon_path});
- this._star[i] = new St.Button({style_class: 'button-star', x_align: St.Align.START, y_align: St.Align.START});
-
- this._starImage[i].width = 20;
- this._starImage[i].height = 20;
- this._starImage[i].set_child(this._starTexture[i])
-
- this._star[i].set_child(this._starImage[i]);
-}
- if (prepend) {
- this._prepend = new St.Label({style_class: 'popup-inactive-menu-item', text: prepend + " "});
- this._prepend.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
- this.box.add(this._prepend, {row: 0, col: 0, x_fill: true, x_expand: false});
- this.box.add(this._label, {row: 0, col: 1});
- this.box.add(this._star[0], {row: 0, col: 2});
- this.box.add(this._star[1], {row: 0, col: 3});
- this.box.add(this._star[2], {row: 0, col: 4});
- this.box.add(this._star[3], {row: 0, col: 5});
- this.box.add(this._star[4], {row: 0, col: 6});
- }
- else {
- this.box.add(this._label, {row: 0, col: 0});
- this.box.add(this._star[0], {row: 0, col: 1});
- this.box.add(this._star[1], {row: 0, col: 2});
- this.box.add(this._star[2], {row: 0, col: 3});
- this.box.add(this._star[3], {row: 0, col: 4});
- this.box.add(this._star[4], {row: 0, col: 5});
+ this._starImage = new Array();
+ this._starTexture = new Array();
+ this._starButton = new Array();
+ this._star = new Array();
+ for(i=0; i < 5; i++) {
+ this._starImage[i] = new St.Bin({style_class: 'track-rating'});
+ this._starTexture[i] = new Clutter.Texture({filter_quality: 2, filename: icon_path});
+ this._star[i] = new St.Button({style_class: 'button-star', x_align: St.Align.START, y_align: St.Align.START});
+
+ this._starImage[i].width = 20;
+ this._starImage[i].height = 20;
+ this._starImage[i].set_child(this._starTexture[i])
+
+ this._star[i].set_child(this._starImage[i]);
}
+ this.box.add(this._star[0], {row: 0, col: 2});
+ this.box.add(this._star[1], {row: 0, col: 3});
+ this.box.add(this._star[2], {row: 0, col: 4});
+ this.box.add(this._star[3], {row: 0, col: 5});
+ this.box.add(this._star[4], {row: 0, col: 6});
+
+
this.setValue(value);
},

0 comments on commit 092d494

Please sign in to comment.
Something went wrong with that request. Please try again.