[gnome-music/pl-artists-fixes] widgets: Dim "New Playlist" item in Add to Playlist dialog



commit 5c69f6107b709d4d07d12ff0cf781a81455b8d49
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Wed Apr 9 18:43:15 2014 +0800

    widgets: Dim "New Playlist" item in Add to Playlist dialog
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724627

 gnomemusic/widgets.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index beef88f..836fe97 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -703,6 +703,7 @@ class PlaylistDialog():
         cols.pack_start(type_renderer, True)
         cols.add_attribute(type_renderer, "text", 0)
         cols.add_attribute(type_renderer, "editable", 1)
+        cols.set_cell_data_func(type_renderer, self._on_list_text_render)
         self.view.append_column(cols)
 
     @log
@@ -713,6 +714,14 @@ class PlaylistDialog():
         self.model.set(add_playlist_iter, [0, 1], [_("New Playlist"), True])
 
     @log
+    def _on_list_text_render(self, col, cell, model, _iter, data):
+        editable = model.get_value(_iter, 1)
+        if editable:
+            cell.add_class("dim-label")
+        else:
+            cell.remove_class("dim-label")
+
+    @log
     def _on_selection(self, select_button):
         self.dialog_box.response(Gtk.ResponseType.ACCEPT)
 


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