GNOME Bugzilla – Bug 760171
Restrict the width of the songs list
Last modified: 2016-02-02 14:04:16 UTC
Created attachment 318269 [details] modified screenshot When Music's window is very large, the columns in the songs view can be very far away from each other. This makes the list look bad, and makes it hard to read. The obvious fix for this would be to give the list a maximum width, so that it doesn't grow above a certain level. I've attached a modified screenshot, to show what this would look like.
A similar bug was just fixed in Software: bug 758662.
It may not be too useful for the GNOME Lovers who will come here and try to fix this bug because GNOME Software is written in C while GNOME Music is written in Python but it can be taken as a pattern of what should be done. Please feel free to grab the implementation from here: https://git.gnome.org/browse/gnome-software/tree/src/gs-fixed-size-bin.c or from here: https://bugzilla.gnome.org/attachment.cgi?id=318606
Created attachment 320216 [details] [review] Resized songs list
Review of attachment 320216 [details] [review]: Thank you for you patch. --- a/gnomemusic/view.py +++ b/gnomemusic/view.py @@ -488,6 +488,8 @@ class Songs(ViewContainer): @log def _add_list_renderers(self): list_widget = self.view.get_generic_view() + list_widget.set_halign(Gtk.Align.CENTER) + list_widget.set_size_request(1000, -1) I want to avoid magic numbers as much as possible. You already set the width of the renderers for Artist and Type cells. That should be enough. Just drop the set_size_request line above, please.
(In reply to Felipe Borges from comment #4) > Review of attachment 320216 [details] [review] [review]: > > Thank you for you patch. > > --- a/gnomemusic/view.py > +++ b/gnomemusic/view.py > @@ -488,6 +488,8 @@ class Songs(ViewContainer): > @log > def _add_list_renderers(self): > list_widget = self.view.get_generic_view() > + list_widget.set_halign(Gtk.Align.CENTER) > + list_widget.set_size_request(1000, -1) > > I want to avoid magic numbers as much as possible. You already set the width > of the renderers for Artist and Type cells. That should be enough. > > Just drop the set_size_request line above, please. Alright Felipe, I'll do that.
Created attachment 320259 [details] [review] Removed unnecesary size limit.
Looks fine here. I feel that some of the columns aren't quite wide enough, particularly the artist column (album and artist should probably be the same width, also). Not sure if that's this bug or another though.
Created attachment 320262 [details] [review] Resized songs list The song list has been resized, center aligned and the code for size request has been removed
Oh Allan I did not see your comment before uploading the last patch. I'll patch in once more with the artist and album width of the same size.
Created attachment 320263 [details] [review] Resized songs list and column width Apart from the previous fixes, the columns (title, album, artist) have all been given a width of 300.
Thank you.
committed @320263 - Resized songs list and column width