[tracker/tracker-needle-model: 17/25] needle: bring the file view back to life



commit 8776e06233a3665b9bb76bb9b2ce341433e00707
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Mar 22 16:01:48 2011 +0100

    needle: bring the file view back to life

 src/tracker-needle/tracker-needle.vala |   17 ++++++++++++-----
 src/tracker-needle/tracker-view.vala   |   28 ++++++++++++++--------------
 2 files changed, 26 insertions(+), 19 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 952dffa..4e47021 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -251,10 +251,10 @@ public class Tracker.Needle {
 		sw_categories.store.notify["active"].connect (store_state_changed);
 		view.pack_start (sw_categories, true, true, 0);
 
-		// sw_filelist = new Tracker.View (Tracker.View.Display.FILE_LIST, null);
-		// treeview = (TreeView) sw_filelist.get_child ();
-		// treeview.row_activated.connect (view_row_selected);
-		// view.pack_start (sw_filelist, true, true, 0);
+		sw_filelist = new Tracker.View (Tracker.View.Display.FILE_LIST, null);
+		treeview = (TreeView) sw_filelist.get_child ();
+		treeview.row_activated.connect (view_row_selected);
+		view.pack_start (sw_filelist, true, true, 0);
 
 		// sw_icons = new Tracker.View (Tracker.View.Display.FILE_ICONS, null);
 		// iconview = (IconView) sw_icons.get_child ();
@@ -629,7 +629,14 @@ public class Tracker.Needle {
 
 		if (view_filelist.active) {
 			sw_filelist.show ();
-			store = sw_filelist.store;
+
+			if (find_in_contents.active) {
+				store = files_model;
+			} else {
+				store = files_in_title_model;
+			}
+
+			sw_filelist.store = store;
 		} else {
 			sw_filelist.hide ();
 		}
diff --git a/src/tracker-needle/tracker-view.vala b/src/tracker-needle/tracker-view.vala
index 84a0d7b..fe580db 100644
--- a/src/tracker-needle/tracker-view.vala
+++ b/src/tracker-needle/tracker-view.vala
@@ -146,45 +146,45 @@ public class Tracker.View : ScrolledWindow {
 			tv.set_rules_hint (false);
 			tv.set_grid_lines (TreeViewGridLines.VERTICAL);
 			tv.set_headers_visible (true);
-			tv.set_fixed_height_mode (true);
 
 			var renderer1 = new CellRendererPixbuf ();
-			var renderer2 = new Tracker.CellRendererText ();
+			var renderer2 = new Gtk.CellRendererText ();
 
 			col = new TreeViewColumn ();
-			col.set_sizing (TreeViewColumnSizing.FIXED);
+			col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
 			col.pack_start (renderer1, false);
-			col.add_attribute (renderer1, "pixbuf", 0);
+			col.add_attribute (renderer1, "pixbuf", 6);
 			renderer1.xpad = 5;
 			renderer1.ypad = 5;
 
 			col.pack_start (renderer2, true);
-			col.add_attribute (renderer2, "text", 4);
+			//col.add_attribute (renderer2, "text", 2);
+                        renderer2.set_fixed_height_from_font (2);
 			renderer2.ellipsize = Pango.EllipsizeMode.MIDDLE;
-			renderer2.show_fixed_height = false;
 
 			col.set_title (_("File"));
 			col.set_resizable (true);
 			col.set_expand (true);
-			col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
 			col.set_cell_data_func (renderer1, renderer_background_func);
-			col.set_cell_data_func (renderer2, renderer_background_func);
+			col.set_cell_data_func (renderer2, text_renderer_func);
 			tv.append_column (col);
 
-			var renderer3 = new Tracker.CellRendererText ();
+			var renderer3 = new Gtk.CellRendererText ();
+                        renderer3.set_fixed_height_from_font (2);
 			col = new TreeViewColumn ();
-			col.set_sizing (TreeViewColumnSizing.FIXED);
+			col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
 			col.pack_start (renderer3, true);
-			col.add_attribute (renderer3, "text", 6);
+			col.add_attribute (renderer3, "text", 1);
 			col.set_title (_("Last Changed"));
 			col.set_cell_data_func (renderer3, renderer_background_func);
 			tv.append_column (col);
 
-			var renderer4 = new Tracker.CellRendererText ();
+			var renderer4 = new Gtk.CellRendererText ();
+                        renderer4.set_fixed_height_from_font (2);
 			col = new TreeViewColumn ();
-			col.set_sizing (TreeViewColumnSizing.FIXED);
+			col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
 			col.pack_start (renderer4, true);
-			col.add_attribute (renderer4, "text", 7);
+			col.add_attribute (renderer4, "text", 4);
 			col.set_title (_("Size"));
 			col.set_cell_data_func (renderer4, renderer_background_func);
 			tv.append_column (col);



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