[Xfce4-commits] <postler:master> Ellipsise folder names in the middle

Christian Dywan noreply at xfce.org
Thu Dec 9 22:34:01 CET 2010


Updating branch refs/heads/master
         to e2c4a15ebda3979752282ae41bc4d8c4de1c1757 (commit)
       from 6fcae4241ad9c3dd86199a4f247f3a1a657e8b79 (commit)

commit e2c4a15ebda3979752282ae41bc4d8c4de1c1757
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Dec 9 22:30:03 2010 +0100

    Ellipsise folder names in the middle
    
    Fixes: https://bugs.launchpad.net/postler/+bug/688226

 postler/postler-folders.vala |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 5c52873..b774a9f 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -31,6 +31,7 @@ public class Postler.Folders : Gtk.TreeView {
     enum Columns {
         ICON,
         NAME,
+        ELLIPSIZE,
         LOCATION,
         INFO,
         TOPLEVEL_MONITOR,
@@ -41,15 +42,16 @@ public class Postler.Folders : Gtk.TreeView {
     public Folders (Accounts accounts) {
         this.accounts = accounts;
         Notify.init ("Postler");
-        store = new Gtk.TreeStore (7,
-            typeof (string), typeof (string), typeof (string),
+        store = new Gtk.TreeStore (8,
+            typeof (string), typeof (string), typeof (int), typeof (string),
             typeof (AccountInfo),
             typeof (GLib.FileMonitor), typeof (GLib.FileMonitor), typeof (GLib.FileMonitor));
         set_model (store);
         insert_column_with_attributes (-1, "Icon",
             new Gtk.CellRendererPixbuf (), "stock-id", Columns.ICON);
         insert_column_with_attributes (-1, "Folder",
-            new Gtk.CellRendererText (), "text", Columns.NAME);
+            new Gtk.CellRendererText (), "text", Columns.NAME,
+                                         "ellipsize", Columns.ELLIPSIZE);
         GLib.Idle.add (populate);
     }
 
@@ -123,6 +125,7 @@ public class Postler.Folders : Gtk.TreeView {
                 store.insert_with_values (null, null, -1,
                     Columns.ICON, STOCK_FOLDER_SAVED_SEARCH,
                     Columns.NAME, account_info.name,
+                    Columns.ELLIPSIZE, Pango.EllipsizeMode.MIDDLE,
                     Columns.INFO, account_info,
                     Columns.LOCATION, account_info.path);
                 continue;
@@ -163,6 +166,7 @@ public class Postler.Folders : Gtk.TreeView {
                     store.insert_with_values (out account_iter, null, -1,
                         Columns.ICON, Gtk.STOCK_DIRECTORY,
                         Columns.NAME, account_info.name,
+                        Columns.ELLIPSIZE, Pango.EllipsizeMode.MIDDLE,
                         Columns.LOCATION, null,
                         Columns.INFO, account_info,
                         Columns.TOPLEVEL_MONITOR, monitor);
@@ -206,6 +210,7 @@ public class Postler.Folders : Gtk.TreeView {
                             store.insert_with_values (out parent_iter, account_iter, -1,
                                 Columns.ICON, Gtk.STOCK_DIRECTORY,
                                 Columns.NAME, parent,
+                                Columns.ELLIPSIZE, Pango.EllipsizeMode.MIDDLE,
                                 Columns.LOCATION, folder_dir_path + "/" + parent_path,
                                 Columns.INFO, account_info);
                         }
@@ -250,6 +255,7 @@ public class Postler.Folders : Gtk.TreeView {
                         folder.localized != null ? account_iter : parent_iter, -1,
                         Columns.ICON, folder.stock_id ?? Gtk.STOCK_DIRECTORY,
                         Columns.NAME, folder.label ?? folder_name,
+                        Columns.ELLIPSIZE, Pango.EllipsizeMode.MIDDLE,
                         Columns.LOCATION, account_info.path + "/" + name,
                         Columns.INFO, account_info,
                         Columns.FOLDER_MONITOR, monitor);



More information about the Xfce4-commits mailing list