[gnome-music] Fix checkbuttons in songs & playlist view



commit b9a8df9b00649b7dac5d5f84213cf8648fbcca19
Author: Saiful B. Khan <saifulbkhan gmail com>
Date:   Tue Jan 26 22:04:29 2016 +0530

    Fix checkbuttons in songs & playlist view
    
    The checkboxes in Songs view and Playlist view
    have boxes similar to those in the Albums grid
    view (only rescaled). Also the position of
    checkboxes is non-standard. They should appear
    at the start of the row, before the title & not
    after it.
    
    The fix for checkbuttons' appearance involves
    removing the 'content-view' class from style
    classes for the Songs and Playlists window.
    To adjust the position of checkbuttons to the
    start of the row, the new instance of GtkTreeView
    for containing title renderer was removed and code
    from Playlist view's title renderer was used to
    acheive the desired effect. An additional width
    parameter was added to title renderer to resolve
    'star' position readjusting everytime the window
    was redrawn, during runtime.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760170

 gnomemusic/view.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 2cbe0a7..cc4461c 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -418,6 +418,7 @@ class Songs(ViewContainer):
         self._iconHeight = 32
         self._iconWidth = 32
         self._add_list_renderers()
+        self.view.get_generic_view().get_style_context().remove_class('content-view')
         self.player = player
         self.player.connect('playlist-item-changed', self.update_model)
 
@@ -507,16 +508,13 @@ class Songs(ViewContainer):
             xalign=0.0,
             yalign=0.5,
             height=48,
+            width=500,
             ellipsize=Pango.EllipsizeMode.END
         )
 
-        col = Gtk.TreeViewColumn()
-        col.set_expand(True)
-        col.pack_start(title_renderer, True)
-        col.set_cell_data_func(title_renderer,
-                               self._on_list_widget_title_render, None)
-        col.add_attribute(title_renderer, 'text', 2)
-        list_widget.insert_column(col, 1)
+        list_widget.add_renderer(title_renderer,
+                                 self._on_list_widget_title_render, None)
+        cols[0].add_attribute(title_renderer, 'text', 2)
 
         self.star_handler._add_star_renderers(list_widget, cols)
 
@@ -821,6 +819,7 @@ class Playlist(ViewContainer):
         self.view.get_generic_view().get_style_context()\
             .add_class('songs-list')
         self._add_list_renderers()
+        self.view.get_generic_view().get_style_context().remove_class('content-view')
 
         builder = Gtk.Builder()
         builder.add_from_resource('/org/gnome/Music/PlaylistControls.ui')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]