Skip to content

Commit

Permalink
add size restriction on album cover
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Nov 10, 2012
1 parent b9c565e commit b4fdacf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions extension.js
Expand Up @@ -21,7 +21,8 @@ ExaileDoubanFMButton.prototype = {
this.actor.add_actor(this._label);
this.actor.hide();

this.cover = new St.Bin({});
this.cover = new St.Bin({style_class: 'album_cover'});
this.cover._size = 96;
this.menu.addActor(this.cover);

this._labels = new PopupMenu.PopupMenuItem(_('Stopped'), {reactive: false});
Expand All @@ -37,7 +38,7 @@ ExaileDoubanFMButton.prototype = {
this._skip.connect('activate', Lang.bind(this, this._onSkipClicked));
this.menu.addMenuItem(this._skip);

this._delete = new PopupMenu.PopupMenuItem(_('Delete'));
this._delete = new PopupMenu.PopupMenuItem(_('Trash'));
this._delete.connect('activate', Lang.bind(this, this._onDeleteClicked));
this.menu.addMenuItem(this._delete);

Expand Down Expand Up @@ -74,7 +75,9 @@ ExaileDoubanFMButton.prototype = {

textureCache = St.TextureCache.get_default();
this.cover.set_child(
textureCache.load_uri_async(album_art, 120, 120));
textureCache.load_uri_async(album_art,
this.cover._size,
this.cover._size));

//this._labels.label.clutter_text.markup = html
if(fav == "1") {
Expand Down
4 changes: 4 additions & 0 deletions stylesheet.css
Expand Up @@ -5,4 +5,8 @@
b {
font-weight:bold !important;
}
.album_cover {
width:96px;
height:96px;
}

0 comments on commit b4fdacf

Please sign in to comment.