mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] Changes to mldonkey/src/gtk2/gui/guiUsers.ml


From: mldonkey-commits
Subject: [Mldonkey-commits] Changes to mldonkey/src/gtk2/gui/guiUsers.ml
Date: Sat, 12 Nov 2005 06:16:49 -0500

Index: mldonkey/src/gtk2/gui/guiUsers.ml
diff -u mldonkey/src/gtk2/gui/guiUsers.ml:1.2 
mldonkey/src/gtk2/gui/guiUsers.ml:1.3
--- mldonkey/src/gtk2/gui/guiUsers.ml:1.2       Mon Oct 31 18:34:02 2005
+++ mldonkey/src/gtk2/gui/guiUsers.ml   Sat Nov 12 11:16:36 2005
@@ -208,14 +208,17 @@
 (*************************************************************************)
 
         method content (col : GTree.view_column) c =
+          let autosize = match col#sizing with `AUTOSIZE -> true | _ -> false 
in
           match c with
               Col_user_name ->
                 begin
                   let renderer = GTree.cell_renderer_text [`XALIGN 0.] in
                   col#pack renderer;
-                  col#set_cell_data_func renderer
-                    (fun model row ->
-                       match !R.view_context with
+                  if autosize
+                    then col#add_attribute renderer "text" user_name
+                    else col#set_cell_data_func renderer
+                      (fun model row ->
+                         match !R.view_context with
                            Some context when col#width > 0 ->
                              begin
                                let width = col#width - 4 * !G.char_width in
@@ -223,8 +226,8 @@
                                let s = GuiTools.fit_string_to_pixels name 
~context ~pixels:width in
                                renderer#set_properties [ `TEXT s ]
                              end
-                    | _ -> renderer#set_properties [ `TEXT "" ]
-                  )
+                         | _ -> renderer#set_properties [ `TEXT "" ]
+                      )
                 end
 
             | Col_user_addr ->




reply via email to

[Prev in Thread] Current Thread [Next in Thread]