[gnome-music] fix spaces and indentations
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] fix spaces and indentations
- Date: Mon, 1 Apr 2013 22:42:56 +0000 (UTC)
commit 0cb557589bee2e2410c9711e2e0396ae588f49c2
Author: Eslam Mostafa <cseslam gmail com>
Date: Mon Apr 1 23:55:41 2013 +0200
fix spaces and indentations
Signed-off-by: Seif Lotfy <seif lotfy com>
src/clickable_label.js | 34 -----------------
src/main.js | 4 +-
src/models.js | 96 ------------------------------------------------
src/player.js | 36 +++++++++---------
src/searchbar.js | 26 ++++++------
src/view.js | 18 ++++----
src/widgets.js | 16 ++++----
src/window.js | 8 ++--
8 files changed, 53 insertions(+), 185 deletions(-)
---
diff --git a/src/main.js b/src/main.js
index ed27969..759a0c8 100644
--- a/src/main.js
+++ b/src/main.js
@@ -22,9 +22,7 @@ pkg.initSubmodule('libgd')
const GIRepository = imports.gi.GIRepository;
const App = imports.application;
-let app = new App.Application();
-//app.run(ARGV);
-
function main(argv) {
+ let app = new App.Application();
return app.run(argv);
}
diff --git a/src/player.js b/src/player.js
index e6372db..13f8fc9 100644
--- a/src/player.js
+++ b/src/player.js
@@ -80,8 +80,8 @@ const Player = new Lang.Class({
this.eventbox.set_spacing(9)
this.eventbox.set_border_width(9)
toolbar_start = new Gtk.Box({
- orientation: Gtk.Orientation.HORIZONTAL,
- spacing: 0
+ orientation: Gtk.Orientation.HORIZONTAL,
+ spacing: 0
});
toolbar_start.get_style_context().add_class(Gtk.STYLE_CLASS_LINKED);
@@ -102,40 +102,40 @@ const Player = new Lang.Class({
this.eventbox.pack_start(toolbar_start, false, false, 3)
toolbar_song_info = new Gtk.Box({
- orientation: Gtk.Orientation.HORIZONTAL,
- spacing: 0
+ orientation: Gtk.Orientation.HORIZONTAL,
+ spacing: 0
});
this.cover_img = new Gtk.Image();
toolbar_song_info.pack_start(this.cover_img, false, false, 0);
databox = new Gtk.Box({
- orientation: Gtk.Orientation.VERTICAL,
- spacing: 0
+ 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: ""
+ label: ""
});
databox.pack_start(this.title_lbl, false, false, 0);
artist_lbl = new Gtk.Label({
- label: ""
+ label: ""
});
artist_lbl.get_style_context().add_class("dim-label");
databox.pack_start(artist_lbl, false, false, 0);
toolbar_center = new Gtk.Box({
- orientation: Gtk.Orientation.HORIZONTAL,
- spacing: 0
+ orientation: Gtk.Orientation.HORIZONTAL,
+ spacing: 0
});
this.progress_scale = new Gtk.Scale({
- orientation: Gtk.Orientation.HORIZONTAL,
- sensitive: false
+ orientation: Gtk.Orientation.HORIZONTAL,
+ sensitive: false
});
this.progress_scale.set_draw_value(false);
this._setDuration(1);
@@ -158,14 +158,14 @@ const Player = new Lang.Class({
this.eventbox.pack_start(toolbar_center, true, true, 0)
toolbar_end = new Gtk.Box({
- orientation: Gtk.Orientation.HORIZONTAL,
- spacing: 5
+ orientation: Gtk.Orientation.HORIZONTAL,
+ spacing: 5
});
alignment = new Gtk.Alignment({
- xalign: 1,
- yalign: 0.5,
- xscale: 0,
- yscale: 0
+ xalign: 1,
+ yalign: 0.5,
+ xscale: 0,
+ yscale: 0
});
this.eventbox.pack_end(toolbar_end, false, false, 3);
diff --git a/src/searchbar.js b/src/searchbar.js
index 29344c4..e7412c4 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -35,30 +35,30 @@ const Searchbar = new Lang.Class({
_init: function() {
this._setup_ui();
},
-
+
_setup_ui: function() {
this._eventbox = new Gtk.EventBox();
//this._eventbox.margin_top = 5;
//this._eventbox.margin_bottom = 5;
-
+
let container = new Gd.MarginContainer();
//container.min_margin = 64;
//container.max_margin = 128;
this._eventbox.add (container);
-
+
let box = new Gtk.Box({orientation: Gtk.Orientation.HORIZONTAL, spacing : 0});
container.add(box);
-
+
this._search_entry = new Gd.TaggedEntry();
this._search_entry.hexpand = true;
this._search_entry.key_press_event.connect (on_search_entry_key_pressed);
this._search_entry.changed.connect (on_search_entry_changed);
this._search_entry.tag_clicked.connect (on_search_entry_tag_clicked);
box.add (this._search_entry);
-
+
this._eventbox.show_all();
},
-
+
_on_search_entry_key_pressed: function(e) {
let keyval = e.keyval;
@@ -66,30 +66,30 @@ const Searchbar = new Lang.Class({
//App.app.search_mode = false;
return true;
}
-
+
return false;
},
-
+
_on_search_entry_changed: function() {
debug("2");
},
-
+
_on_search_entry_tag_clicked: function() {
debug("3");
},
-
+
show: function() {
this.actor.show();
},
-
+
hide: function() {
this.actor.hide();
},
-
+
grab_focus: function() {
this._search_entry.grab_focus();
},
-
+
});
const Dropdown = new Lang.Class({
diff --git a/src/view.js b/src/view.js
index 0092b43..0016c42 100644
--- a/src/view.js
+++ b/src/view.js
@@ -292,16 +292,16 @@ const Albums = new Lang.Class({
},
_onItemActivated: function (widget, id, path) {
- var iter = this._model.get_iter (path)[1]
- var title = this._model.get_value (iter, 2)
- var artist = this._model.get_value (iter, 3)
- var item = this._model.get_value (iter, 5)
- var window = new Gtk.Window ()
- this._albumWidget.update (artist, title, item)
+ var iter = this._model.get_iter (path)[1];
+ var title = this._model.get_value (iter, 2);
+ var artist = this._model.get_value (iter, 3);
+ var item = this._model.get_value (iter, 5);
+ var window = new Gtk.Window ();
+ this._albumWidget.update (artist, title, item);
this.header_bar.setState (0);
- this.header_bar.title = title
- this.header_bar.sub_title = artist
- this.visible_child = this._albumWidget
+ this.header_bar.title = title;
+ this.header_bar.sub_title = artist;
+ this.visible_child = this._albumWidget;
},
populate: function() {
diff --git a/src/widgets.js b/src/widgets.js
index 5a1498d..7e9158d 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -32,9 +32,9 @@ const albumArtCache = AlbumArtCache.AlbumArtCache.getDefault();
const ClickableLabel = new Lang.Class({
Name: "ClickableLabel",
- Extends: Gtk.Button,
+ Extends: Gtk.Button,
- _init: function (track) {
+ _init: function (track) {
this.track = track
var text = track.get_title()
var duration = track.get_duration()
@@ -143,7 +143,7 @@ const AlbumWidget = new Lang.Class({
update: function (artist, album, item) {
var pixbuf = albumArtCache.lookup (256, artist, item.get_string(Grl.METADATA_KEY_ALBUM));
let duration = 0;
- for (let t in this.tracks_labels) {
+ for (let t in this.tracks_labels) {
this.songsList.remove(this.tracks_labels[t]);
}
this.tracks_labels = {};
@@ -157,14 +157,14 @@ const AlbumWidget = new Lang.Class({
}));
//update labels view
- var i = 0 ;
- for (let t in this.tracks_labels) {
- let length = new Gtk.Label ({label : tracks[t]}); //use this._toTimeLength()
+ var i = 0 ;
+ for (let t in this.tracks_labels) {
+ let length = new Gtk.Label ({label : tracks[t]});
this.songsList.pack_start(this.tracks_labels[t], false, false, 0);
this.running_length = this.running_length+ parseInt(tracks[t], 10);
i++;
}
-
+
if (pixbuf == null) {
let path = "/usr/share/icons/gnome/scalable/places/folder-music-symbolic.svg";
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(path, -1, 256, true);
@@ -172,7 +172,7 @@ const AlbumWidget = new Lang.Class({
this.cover.set_from_pixbuf (pixbuf);
this.setArtistLabel(artist);
- this.setTitleLabel(album);
+ this.setTitleLabel(album);
},
setArtistLabel: function(artist) {
diff --git a/src/window.js b/src/window.js
index 24ecee5..b224378 100644
--- a/src/window.js
+++ b/src/window.js
@@ -17,7 +17,7 @@
* Author: Eslam Mostafa <cseslam gmail com>
*
*/
-
+
const Lang = imports.lang;
const Gtk = imports.gi.Gtk;
const Gd = imports.gi.Gd;
@@ -33,7 +33,7 @@ const Player = imports.player;
const MainWindow = new Lang.Class({
Name: "MainWindow",
Extends: Gtk.ApplicationWindow,
-
+
_init: function (app) {
this.parent({
application: app,
@@ -89,8 +89,8 @@ const MainWindow = new Lang.Class({
_onNotifyMode: function(stack, param) {
stack.get_visible_child().populate();
- },
-
+ },
+
_toggleView: function(btn, i) {
this._stack.set_visible_child(this.views[i])
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]