[gnome-music/wip/jfelder/reorder-searchview-model] foo
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/reorder-searchview-model] foo
- Date: Fri, 23 Feb 2018 13:22:32 +0000 (UTC)
commit 98684872fef5669aae161210c8e64319c894b865
Author: Jean Felder <jfelder src gnome org>
Date: Fri Feb 23 14:03:01 2018 +0100
foo
gnomemusic/views/searchview.py | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 6f65760..2f1ae9e 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -311,28 +311,30 @@ class SearchView(BaseView):
cols[0].set_cell_data_func(
cells[0], self._on_list_widget_selection_render, None)
+ cols[0].set_cell_data_func(
+ cells[2], self._on_list_widget_infos_render, None)
+
@log
def _on_list_widget_pixbuf_renderer(self, col, cell, model, _iter, data):
- if not model[_iter][13]:
- return
-
- cell.set_property("surface", model[_iter][13])
+ if not model[_iter][13] or not model.iter_parent(_iter):
+ cell.set_visible(False)
+ else:
+ cell.set_visible(True)
+ cell.set_property("surface", model[_iter][13])
@log
def _on_list_widget_selection_render(self, col, cell, model, _iter, data):
- if (self._view.get_selection_mode()
- and model.iter_parent(_iter) is not None):
- cell.set_visible(True)
- else:
- cell.set_visible(False)
+ cell.set_visible(
+ self._view.get_selection_mode()
+ and model.iter_parent(_iter) is not None)
@log
def _on_list_widget_title_render(self, col, cell, model, _iter, data):
- cells = col.get_cells()
- cells[0].set_visible(False)
- cells[1].set_visible(model.iter_parent(_iter) is not None)
- cells[2].set_visible(model.iter_parent(_iter) is not None)
- cells[3].set_visible(model.iter_parent(_iter) is None)
+ cell.set_visible(model.iter_parent(_iter) is None)
+
+ @log
+ def _on_list_widget_infos_render(self, col, cell, model, _iter, data):
+ cell.set_visible(model.iter_parent(_iter) is not None)
@log
def populate(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]