[gnome-music] Add some padding according to Hylbe Bons to the albumWidget
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Add some padding according to Hylbe Bons to the albumWidget
- Date: Tue, 2 Apr 2013 12:33:03 +0000 (UTC)
commit 023f94925ffcf197a5a3b853fa220673b311b724
Author: Seif Lotfy <seif lotfy com>
Date: Tue Apr 2 14:28:39 2013 +0200
Add some padding according to Hylbe Bons to the albumWidget
src/player.js | 35 +++++++++++++++++++----------------
src/widgets.js | 21 +++++++++++++--------
2 files changed, 32 insertions(+), 24 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index af33d72..64837ce 100644
--- a/src/player.js
+++ b/src/player.js
@@ -101,22 +101,27 @@ const Player = new Lang.Class({
this.eventbox.pack_start(toolbar_start, false, false, 3)
- toolbar_song_info = new Gtk.Box({
+
+ this.progress_scale = new Gtk.Scale({
+ orientation: Gtk.Orientation.HORIZONTAL,
+ sensitive: false
+ });
+ this.progress_scale.set_draw_value(false);
+ this._setDuration(1);
+ this.progress_scale.connect("change_value", Lang.bind(this, this.onProgressScaleChangeValue));
+
+ this.toolbar_song_info = new Gtk.Box({
orientation: Gtk.Orientation.HORIZONTAL,
spacing: 0
});
-
+
this.cover_img = new Gtk.Image();
- toolbar_song_info.pack_start(this.cover_img, false, false, 0);
-
+ this.toolbar_song_info.pack_start(this.cover_img, false, false, 0);
databox = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
spacing: 0
});
- toolbar_song_info.pack_start(databox, false, false, 0);
- toolbar_start.pack_start(toolbar_song_info, false, false, 9)
-
-
+
this.title_lbl = new Gtk.Label({
label: ""
});
@@ -132,15 +137,12 @@ const Player = new Lang.Class({
orientation: Gtk.Orientation.HORIZONTAL,
spacing: 0
});
-
- this.progress_scale = new Gtk.Scale({
- orientation: Gtk.Orientation.HORIZONTAL,
- sensitive: false
- });
- this.progress_scale.set_draw_value(false);
- this._setDuration(1);
- this.progress_scale.connect("change_value", Lang.bind(this, this.onProgressScaleChangeValue));
+
+ this.toolbar_song_info.pack_start(databox, false, false, 0);
+
+ toolbar_center.pack_start(this.toolbar_song_info, false, false, 3);
toolbar_center.pack_start(this.progress_scale, true, true, 0);
+ toolbar_center.pack_start(new Gtk.Label({}), false, false, 3);
/*this.song_playback_time_lbl = new Gtk.Label({
label: "00:00"
@@ -155,6 +157,7 @@ const Player = new Lang.Class({
});
toolbar_center.pack_start(this.song_total_time_lbl, false, false, 0);
*/
+
this.eventbox.pack_start(toolbar_center, true, true, 0)
toolbar_end = new Gtk.Box({
diff --git a/src/widgets.js b/src/widgets.js
index 961a237..c8c852e 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -35,6 +35,7 @@ const ClickableLabel = new Lang.Class({
Extends: Gtk.Box,
_init: function (track) {
+ this.parent();
this.track = track
var text = track.get_title()
var duration = track.get_duration()
@@ -53,9 +54,9 @@ const ClickableLabel = new Lang.Class({
let length_label = new Gtk.Label({ label : time });
length_label.set_alignment(1.0, 0.5)
- this.parent();
box.pack_start(label, true, true, 0);
box.pack_end(length_label, true, true, 0);
+ box.set_spacing(15)
this.button = new Gtk.Button ();
this.button.add(box);
this.pack_start(this.button, true, true, 0);
@@ -126,9 +127,13 @@ const AlbumWidget = new Lang.Class({
this.vbox.pack_start (new Gtk.Label({label:""}), false, false, 24);
this.vbox.pack_start (this.cover, false, false, 0);
- this.vbox.pack_start (this.title_label, false, false, 9);
- this.vbox.pack_start (this.artist_label, false, false, 0);
- this.vbox.pack_start (new Gtk.Label({label:""}), false, false, 6);
+
+ let artistBox = new Gtk.VBox();
+ artistBox.set_spacing(6);
+ artistBox.pack_start (this.title_label, false, false, 0);
+ artistBox.pack_start (this.artist_label, false, false, 0);
+
+ this.vbox.pack_start (artistBox, false, false, 24);
this.vbox.pack_start(this.infobox, false, false, 0)
this.box.pack_end (this.scrolledWindow, true, true, 0);
@@ -152,11 +157,11 @@ const AlbumWidget = new Lang.Class({
if (i > 0 && i < children.length - 1)
this.songsList.remove(children[i]);
}
+ this.tracks_labels = {};
grilo.getAlbumSongs(item.get_id(), Lang.bind(this, function (source, prefs, track) {
if (track != null) {
- duration = duration + track.get_duration()
- this.tracks_labels[track.get_title()] = new ClickableLabel (track);
- this.songsList.pack_start(this.tracks_labels[track.get_title()], false, false, 0);
+ duration = duration + track.get_duration();
+ this.songsList.pack_start(new ClickableLabel (track), false, false, 0);
this.running_length_label_info.set_text((parseInt(duration/60) + 1) + " min")
}
}));
@@ -172,7 +177,7 @@ const AlbumWidget = new Lang.Class({
},
setArtistLabel: function(artist) {
- this.artist_label.set_markup("<b><span size='large' color='grey'>" + artist + "</span></b>");
+ this.artist_label.set_markup("<span size='large' color='grey'>" + artist + "</span>");
},
setTitleLabel: function(title) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]