After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760171 - Restrict the width of the songs list
Restrict the width of the songs list
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2016-01-05 17:58 UTC by Allan Day
Modified: 2016-02-02 14:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modified screenshot (122.54 KB, image/png)
2016-01-05 17:58 UTC, Allan Day
  Details
Resized songs list (2.01 KB, patch)
2016-02-01 19:32 UTC, Saiful B. Khan
needs-work Details | Review
Removed unnecesary size limit. (1.01 KB, patch)
2016-02-02 11:43 UTC, Saiful B. Khan
none Details | Review
Resized songs list (1.94 KB, patch)
2016-02-02 12:48 UTC, Saiful B. Khan
none Details | Review
Resized songs list and column width (2.04 KB, patch)
2016-02-02 13:13 UTC, Saiful B. Khan
committed Details | Review

Description Allan Day 2016-01-05 17:58:50 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.
Comment 1 Allan Day 2016-01-11 15:58:50 UTC
A similar bug was just fixed in Software: bug 758662.
Comment 2 Rafal Luzynski 2016-01-11 22:47:36 UTC
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
Comment 3 Saiful B. Khan 2016-02-01 19:32:39 UTC
Created attachment 320216 [details] [review]
Resized songs list
Comment 4 Felipe Borges 2016-02-02 08:25:24 UTC
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.
Comment 5 Saiful B. Khan 2016-02-02 09:03:54 UTC
(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.
Comment 6 Saiful B. Khan 2016-02-02 11:43:33 UTC
Created attachment 320259 [details] [review]
Removed unnecesary size limit.
Comment 7 Allan Day 2016-02-02 12:07:21 UTC
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.
Comment 8 Saiful B. Khan 2016-02-02 12:48:47 UTC
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
Comment 9 Saiful B. Khan 2016-02-02 12:51:35 UTC
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.
Comment 10 Saiful B. Khan 2016-02-02 13:13:36 UTC
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.
Comment 11 Felipe Borges 2016-02-02 14:03:35 UTC
Thank you.
Comment 12 Felipe Borges 2016-02-02 14:04:16 UTC
committed @320263 - Resized songs list and column width