[smuxi/experiments/any_server_support: 26/34] Frontend-GNOME: chat list shrinkage support (closes: #914)



commit 3d7a01dd1e3f6f84d6ee8840e3c3d090b205ea62
Author: Mirco Bauer <meebey meebey net>
Date:   Sun Jan 26 14:36:40 2014 +0100

    Frontend-GNOME: chat list shrinkage support (closes: #914)
    
    Allow the chat list to be shrunken by truncating the end of the chat name. The
    default size of the chat list is now 1/6 of the window with.

 src/Frontend-GNOME/MainWindow.cs         |   12 +++++++++++-
 src/Frontend-GNOME/Views/ChatTreeView.cs |    5 ++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/Frontend-GNOME/MainWindow.cs b/src/Frontend-GNOME/MainWindow.cs
index 358443f..e3c92fa 100644
--- a/src/Frontend-GNOME/MainWindow.cs
+++ b/src/Frontend-GNOME/MainWindow.cs
@@ -1,7 +1,7 @@
 /*
  * Smuxi - Smart MUltipleXed Irc
  *
- * Copyright (c) 2005-2013 Mirco Bauer <meebey meebey net>
+ * Copyright (c) 2005-2014 Mirco Bauer <meebey meebey net>
  *
  * Full GPL License: <http://www.gnu.org/licenses/gpl.txt>
  *
@@ -44,6 +44,7 @@ namespace Smuxi.Frontend.Gnome
         public Gtk.ProgressBar ProgressBar { get; private set; }
         Gtk.HBox StatusHBox { get; set; }
         public MenuWidget MenuWidget { get; private set; }
+        Gtk.HPaned TreeViewHPaned { get; set; }
 
         public IFrontendUI UI { get; private set; }
         public Entry Entry { get; private set; }
@@ -262,6 +263,7 @@ namespace Smuxi.Frontend.Gnome
             var treeviewPaned = new Gtk.HPaned();
             treeviewPaned.Pack1(treeviewScrolledWindow, false, false);
             treeviewPaned.Pack2(Notebook, true, false);
+            TreeViewHPaned = treeviewPaned;
 
             var entryPaned = new Gtk.VPaned();
             entryPaned.ButtonPressEvent += (sender, e) => {
@@ -371,6 +373,14 @@ namespace Smuxi.Frontend.Gnome
             Title = title;
         }
 
+        protected override bool OnConfigureEvent(Gdk.EventConfigure e)
+        {
+            Trace.Call(e);
+
+            TreeViewHPaned.Position = e.Width / 6;
+            return base.OnConfigureEvent(e);
+        }
+
         protected virtual void OnDeleteEvent(object sender, Gtk.DeleteEventArgs e)
         {
             Trace.Call(sender, e);
diff --git a/src/Frontend-GNOME/Views/ChatTreeView.cs b/src/Frontend-GNOME/Views/ChatTreeView.cs
index 1abccf3..19f2f6a 100644
--- a/src/Frontend-GNOME/Views/ChatTreeView.cs
+++ b/src/Frontend-GNOME/Views/ChatTreeView.cs
@@ -97,9 +97,12 @@ namespace Smuxi.Frontend.Gnome
             column.SetCellDataFunc(iconRenderer, new Gtk.TreeCellDataFunc(RenderChatViewIcon));
             AppendColumn(column);
 
-            var cellRenderer = new Gtk.CellRendererText();
+            var cellRenderer = new Gtk.CellRendererText() {
+                Ellipsize = Pango.EllipsizeMode.End
+            };
             column = new Gtk.TreeViewColumn(null, cellRenderer);
             column.Spacing = 0;
+            column.Expand = true;
             column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
             column.SetCellDataFunc(cellRenderer, new Gtk.TreeCellDataFunc(RenderChatViewName));
             AppendColumn(column);


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