[gnome-music] widgets: Set song title max width in Artists view
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] widgets: Set song title max width in Artists view
- Date: Mon, 24 Nov 2014 12:27:47 +0000 (UTC)
commit 0cbb6f7b07faa6094d62edf6cf58bdddec5cd45d
Author: Arnel Borja <arnelborja src gnome org>
Date: Sat Nov 22 19:34:16 2014 +0800
widgets: Set song title max width in Artists view
https://bugzilla.gnome.org/show_bug.cgi?id=729459
data/ArtistAlbumWidget.ui | 2 +-
data/TrackWidget.ui | 1 +
gnomemusic/widgets.py | 7 +++++--
3 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/data/ArtistAlbumWidget.ui b/data/ArtistAlbumWidget.ui
index e9ac427..637d78f 100644
--- a/data/ArtistAlbumWidget.ui
+++ b/data/ArtistAlbumWidget.ui
@@ -117,7 +117,7 @@
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
diff --git a/data/TrackWidget.ui b/data/TrackWidget.ui
index a244444..f2c5eb4 100644
--- a/data/TrackWidget.ui
+++ b/data/TrackWidget.ui
@@ -80,6 +80,7 @@
<property name="valign">start</property>
<property name="xalign">0</property>
<property name="ellipsize">end</property>
+ <property name="max-width-chars">20</property>
</object>
<packing>
<property name="expand">True</property>
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index 0204274..d00467b 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -350,6 +350,7 @@ class ArtistAlbums(Gtk.Box):
False, False, 0)
self._hbox.pack_start(self._albumBox, False, False, 16)
self._coverSizeGroup = Gtk.SizeGroup.new(Gtk.SizeGroupMode.HORIZONTAL)
+ self._songsGridSizeGroup = Gtk.SizeGroup.new(Gtk.SizeGroupMode.HORIZONTAL)
self.pack_start(self._scrolledWindow, True, True, 0)
for album in albums:
@@ -365,6 +366,7 @@ class ArtistAlbums(Gtk.Box):
self.header_bar, self.selectionModeAllowed
)
self._coverSizeGroup.add_widget(widget.cover)
+ self._songsGridSizeGroup.add_widget(widget.songsGrid)
self._albumBox.pack_start(widget, False, False, 0)
self.widgets.append(widget)
@@ -488,6 +490,7 @@ class ArtistAlbumWidget(Gtk.Box):
self.cover = self.ui.get_object('cover')
self.cover.set_from_pixbuf(self.pixbuf)
+ self.songsGrid = self.ui.get_object('grid1')
self.ui.get_object('title').set_label(album.get_title())
if album.get_creation_date():
self.ui.get_object('year').set_markup(
@@ -525,7 +528,7 @@ class ArtistAlbumWidget(Gtk.Box):
title = AlbumArtCache.get_media_title(track)
ui.get_object('title').set_text(title)
ui.get_object('title').set_alignment(0.0, 0.5)
- self.ui.get_object('grid1').attach(
+ self.songsGrid.attach(
song_widget,
int(i / (len(self.tracks) / 2)),
int(i % (len(self.tracks) / 2)), 1, 1
@@ -554,7 +557,7 @@ class ArtistAlbumWidget(Gtk.Box):
song_widget.can_be_played = True
song_widget.connect('button-release-event',
self.track_selected)
- self.ui.get_object('grid1').show_all()
+ self.songsGrid.show_all()
@log
def _update_album_art(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]