[gnome-music] view: Enable load on-scroll only if in Icon view



commit 76dcc995727ac4d0ae95d0c3cb50e9f8754624eb
Author: Arnel Borja <arnelborja src gnome org>
Date:   Sat May 3 18:41:14 2014 +0800

    view: Enable load on-scroll only if in Icon view
    
    Since the icon view is only used in Albums view, don't connect to draw
    events if a list view is being used. This reduces redraws in other
    views.

 gnomemusic/view.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 9918ed7..2210b6b 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -214,8 +214,9 @@ class ViewContainer(Gtk.Stack):
 
     @log
     def _connect_view(self):
-        self.view.connect_after('draw', self._on_view_draw)
-        self.view.add_events(Gdk.EventMask.EXPOSURE_MASK)
+        if self.view.get_view_type() == Gd.MainViewType.ICON:
+            self.view.connect_after('draw', self._on_view_draw)
+            self.view.add_events(Gdk.EventMask.EXPOSURE_MASK)
 
     @log
     def _on_view_draw(self, widget, cr):


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