nemo r61 - trunk/gtk



Author: arj
Date: Wed Jan  9 15:44:41 2008
New Revision: 61
URL: http://svn.gnome.org/viewvc/nemo?rev=61&view=rev

Log:
Two fixes for search popup

- More room for search results horizontally
- Don't create a new popup on next/prev as it will make the main
  window flicker



Modified:
   trunk/gtk/SearchPopup.cs

Modified: trunk/gtk/SearchPopup.cs
==============================================================================
--- trunk/gtk/SearchPopup.cs	(original)
+++ trunk/gtk/SearchPopup.cs	Wed Jan  9 15:44:41 2008
@@ -66,7 +66,7 @@
 
 			create_window(search_text, pos.first, pos.second);
 
-			popup.SetSizeRequest(444, -1);
+			popup.SetSizeRequest(500, -1);
 
 			int height = get_size();
 
@@ -85,7 +85,7 @@
 				if (height <= 0)
 					break;
 
-				elements.PackStart(create_element(item, search_text, "", delegate { popup.ShowAll(); }), true, true, 5);
+				elements.PackStart(create_element(item, search_text, "", delegate { popup.ShowAll(); }), false, false, 5);
 			}
 			
 			current_page_size = index - offset;
@@ -105,6 +105,7 @@
 
 			if (offset > 0) // prev
 				add_page_link(Mono.Unix.Catalog.GetString("Prev page"), page_navigation, offset, -1);
+
 			if (items.Count > index) // next
 				add_page_link(Mono.Unix.Catalog.GetString("Next page"), page_navigation, offset, current_page_size);
 			else {
@@ -112,10 +113,10 @@
 				empty_box.LeftPadding = 27;
 				empty_box.RightPadding = 27;
 				empty_box.Add(new Gtk.Label());
-				page_navigation.PackStart(empty_box, false, false, 5);
+				page_navigation.PackStart(empty_box, true, true, 5);
 			}
 			
-	        Gtk.Alignment alignment = new Gtk.Alignment(1F, 0.5F, 0F, 0F);
+	        Gtk.Alignment alignment = new Gtk.Alignment(1F, 1F, 0F, 0F);
 			alignment.Add(page_navigation);
 			elements.PackStart(alignment, true, true, 5);
 
@@ -135,7 +136,7 @@
 			System.Console.WriteLine("adding a page link: {0} with offset on click {1}", text, offset);
 			
 			link_wrapper.Add(link);
-			link_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
+			link_wrapper.ButtonPressEvent += delegate {
 				if (current_page != -1) { // next
 					sizes_of_last_pages.Push(current_page);
 					this.offset = offset + current_page;
@@ -154,11 +155,13 @@
 		{
 			System.Console.WriteLine("creating search window");
 
-			if (popup != null)
-				popup.Destroy();
-
-			popup = new Gtk.Window(Gtk.WindowType.Popup);
-			elements = new VBox();
+			if (popup == null) {
+				popup = new Gtk.Window(Gtk.WindowType.Popup);
+				elements = new VBox();
+			} else {
+				foreach (Widget w in popup.Children)
+					w.Destroy();
+			}
 
 	        Gtk.Alignment alignment = new Gtk.Alignment(1F, 0.5F, 0F, 0F);
 			Gtk.EventBox image_wrapper = new EventBox();
@@ -168,12 +171,12 @@
 			if (name == "")
 				throw new Exception("name for an overlay cannot be empty");
 
-			image_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) { 
+			image_wrapper.ButtonPressEvent += delegate { 
 				Singleton<OverlayTracker>.Instance.hide_and_die(name); 
 			};
 			GtkCommon.set_background_color(image_wrapper, "white");
 			alignment.Add(image_wrapper);
-			elements.Add(alignment);
+			elements.PackStart(alignment, false, false, 0);
 			
 			Gtk.Label header = new Gtk.Label();
 			header.Markup = "<big>" + String.Format(Mono.Unix.Catalog.GetString("Search results for: {0}"),  "<b>" + search_text + "</b></big>");



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