[pitivi] medialibrary: Change display structure of medialibrary widget in list view



commit 9157cb498795b4a99cf419ff4865f21df252ab5d
Author: Shivam Tripathi <shivam flash gmail com>
Date:   Sat Feb 18 02:15:39 2017 +0100

    medialibrary: Change display structure of medialibrary widget in list view
    
    Display clip duration in the "Information" column. Remove now not needed
    duration column from the store model. Display thumbnail top aligned
    instead of center aligned.
    
    Fixes T3107
    
    Differential Revision: https://phabricator.freedesktop.org/D1644

 pitivi/medialibrary.py |   15 +++------------
 pitivi/utils/ui.py     |    4 ++++
 2 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 1dd016f..2ada7b6 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -85,14 +85,13 @@ GlobalSettings.addConfigOption('lastClipView',
 
 STORE_MODEL_STRUCTURE = (
     GdkPixbuf.Pixbuf, GdkPixbuf.Pixbuf,
-    str, object, str, str, str, object)
+    str, object, str, str, object)
 
 (COL_ICON_64,
  COL_ICON_128,
  COL_INFOTEXT,
  COL_ASSET,
  COL_URI,
- COL_LENGTH,
  COL_SEARCH_TEXT,
  COL_THUMB_DECORATOR) = list(range(len(STORE_MODEL_STRUCTURE)))
 
@@ -462,6 +461,7 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         self.treeview.append_column(pixbufcol)
         pixcell = Gtk.CellRendererPixbuf()
         pixcell.props.xpad = 6
+        pixcell.set_alignment(0, 0)
         pixbufcol.pack_start(pixcell, True)
         pixbufcol.add_attribute(pixcell, 'pixbuf', COL_ICON_64)
 
@@ -473,17 +473,10 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         namecol.set_min_width(150)
         txtcell = Gtk.CellRendererText()
         txtcell.set_property("ellipsize", Pango.EllipsizeMode.START)
+        txtcell.set_alignment(0, 0)
         namecol.pack_start(txtcell, True)
         namecol.add_attribute(txtcell, "markup", COL_INFOTEXT)
 
-        namecol = Gtk.TreeViewColumn(_("Duration"))
-        namecol.set_expand(False)
-        self.treeview.append_column(namecol)
-        txtcell = Gtk.CellRendererText()
-        txtcell.set_property("yalign", 0.0)
-        namecol.pack_start(txtcell, True)
-        namecol.add_attribute(txtcell, "markup", COL_LENGTH)
-
         # IconView
         self.iconview = Gtk.IconView(model=self.modelFilter)
         self.iconview_scrollwin.add(self.iconview)
@@ -790,14 +783,12 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         self.debug("Adding asset %s", asset.props.id)
 
         thumbs_decorator = AssetThumbnail(asset, self.app.proxy_manager)
-        duration = beautify_length(info.get_duration())
         name = info_name(asset)
         self.pending_rows.append((thumbs_decorator.small_thumb,
                                   thumbs_decorator.large_thumb,
                                   beautify_asset(asset),
                                   asset,
                                   asset.props.id,
-                                  duration,
                                   name,
                                   thumbs_decorator))
         self._flushPendingRows()
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index 911bb53..014364c 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -279,6 +279,10 @@ def beautify_asset(asset):
         if beautified_string:
             res.append(beautified_string)
 
+    duration = beautify_length(asset.get_duration())
+    if duration:
+        res.append (_("<b>Duration:</b> %s" % duration))
+
     if asset.creation_progress < 100:
         res.append(_("<b>Proxy creation progress:</b> %d%%") % asset.creation_progress)
 


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