Making text on lists more thumb friendly
[watersofshiloah] / src / windows / magazines.py
index fa089d6..32c72d5 100644 (file)
@@ -18,8 +18,8 @@ _moduleLogger = logging.getLogger(__name__)
 
 class MagazinesWindow(windows._base.ListWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.ListWindow.__init__(self, player, store, node)
+       def __init__(self, app, player, store, node):
+               windows._base.ListWindow.__init__(self, app, player, store, node)
                self._window.set_title(self._node.title)
 
        @classmethod
@@ -28,12 +28,16 @@ class MagazinesWindow(windows._base.ListWindow):
 
                pixrenderer = gtk.CellRendererPixbuf()
                column = gtk.TreeViewColumn("Covers")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
+               column.set_property("fixed-width", 96)
                column.pack_start(pixrenderer, expand=True)
                column.add_attribute(pixrenderer, "pixbuf", 1)
                yield gobject.TYPE_OBJECT, column
 
                textrenderer = gtk.CellRendererText()
+               hildonize.set_cell_thumb_selectable(textrenderer)
                column = gtk.TreeViewColumn("Magazine")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 2)
                yield gobject.TYPE_STRING, column
@@ -90,7 +94,7 @@ class MagazinesWindow(windows._base.ListWindow):
                self._errorBanner.push_message(str(exception))
 
        def _window_from_node(self, node):
-               issuesWindow = MagazineIssuesWindow(self._player, self._store, node)
+               issuesWindow = MagazineIssuesWindow(self._app, self._player, self._store, node)
                issuesWindow.window.set_modal(True)
                issuesWindow.window.set_transient_for(self._window)
                issuesWindow.window.set_default_size(*self._window.get_size())
@@ -112,8 +116,8 @@ gobject.type_register(MagazinesWindow)
 
 class MagazineIssuesWindow(windows._base.ListWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.ListWindow.__init__(self, player, store, node)
+       def __init__(self, app, player, store, node):
+               windows._base.ListWindow.__init__(self, app, player, store, node)
                self._window.set_title(self._node.title)
 
        @classmethod
@@ -122,12 +126,16 @@ class MagazineIssuesWindow(windows._base.ListWindow):
 
                pixrenderer = gtk.CellRendererPixbuf()
                column = gtk.TreeViewColumn("Covers")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
+               column.set_property("fixed-width", 96)
                column.pack_start(pixrenderer, expand=True)
                column.add_attribute(pixrenderer, "pixbuf", 1)
                yield gobject.TYPE_OBJECT, column
 
                textrenderer = gtk.CellRendererText()
+               hildonize.set_cell_thumb_selectable(textrenderer)
                column = gtk.TreeViewColumn("Issue")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 2)
                yield gobject.TYPE_STRING, column
@@ -181,7 +189,7 @@ class MagazineIssuesWindow(windows._base.ListWindow):
                self._model.row_changed((i, ), treeiter)
 
        def _window_from_node(self, node):
-               issuesWindow = MagazineArticlesWindow(self._player, self._store, node)
+               issuesWindow = MagazineArticlesWindow(self._app, self._player, self._store, node)
                issuesWindow.window.set_modal(True)
                issuesWindow.window.set_transient_for(self._window)
                issuesWindow.window.set_default_size(*self._window.get_size())
@@ -203,8 +211,8 @@ gobject.type_register(MagazineIssuesWindow)
 
 class MagazineArticlesWindow(windows._base.ListWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.ListWindow.__init__(self, player, store, node)
+       def __init__(self, app, player, store, node):
+               windows._base.ListWindow.__init__(self, app, player, store, node)
                self._window.set_title(self._node.title)
 
        @classmethod
@@ -212,7 +220,9 @@ class MagazineArticlesWindow(windows._base.ListWindow):
                yield gobject.TYPE_PYOBJECT, None
 
                textrenderer = gtk.CellRendererText()
+               hildonize.set_cell_thumb_selectable(textrenderer)
                column = gtk.TreeViewColumn("Article")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 1)
                yield gobject.TYPE_STRING, column
@@ -244,7 +254,7 @@ class MagazineArticlesWindow(windows._base.ListWindow):
                self._errorBanner.push_message(str(exception))
 
        def _window_from_node(self, node):
-               issuesWindow = MagazineArticleWindow(self._player, self._store, node)
+               issuesWindow = MagazineArticleWindow(self._app, self._player, self._store, node)
                issuesWindow.window.set_modal(True)
                issuesWindow.window.set_transient_for(self._window)
                issuesWindow.window.set_default_size(*self._window.get_size())
@@ -266,8 +276,8 @@ gobject.type_register(MagazineArticlesWindow)
 
 class MagazineArticleWindow(windows._base.BasicWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.BasicWindow.__init__(self, player, store)
+       def __init__(self, app, player, store, node):
+               windows._base.BasicWindow.__init__(self, app, player, store)
                self._node = node
                self._playerNode = self._player.node
                self._nextSearch = None