'Clear' Search Results



I reworked the fix for Bug 315984 requesting a 'Clear' button.  This is
a little more elegant.

--- BestWindow.cs       2005-10-01 15:15:05.000000000 -0500
+++ BestWindow-ds1.cs   2005-10-01 15:13:36.000000000 -0500
@@ -338,7 +338,7 @@ namespace Best {

                private Gtk.Widget CreateContents ()
                {
-                       Gtk.HBox entryLine = new HBox (false, 3);
+                       Gtk.HBox entryLine = new HBox (false, 4);

                        Gtk.Label words = new Gtk.Label
(Catalog.GetString ("Search terms:"));
                        entryLine.PackStart (words, false, false, 3);
@@ -371,6 +371,11 @@ namespace Best {
                        button.Add (buttonContents);
                        button.Clicked += new EventHandler
(this.DoSearch);
                        entryLine.PackStart (button, false, false, 3);
+
+                       Gtk.Button clearButton = new Gtk.Button ();
+                       clearButton.Label = "Clear";
+                       clearButton.Clicked += new EventHandler
(this.ClearSearch);
+                       entryLine.PackStart (clearButton, false, false,
4);

                        canvas = new TileCanvas ();
                        canvas.Show ();
@@ -611,10 +616,18 @@ namespace Best {

                        return searches;
                }
+
+               private void ClearSearch (object o, EventArgs args)
+               {
+                       root.Clear ();
+                       UpdatePage ();
+                       entry.Text = "";
+               }

                public void ClearHistory ()
                {
                        history.Clear ();
+                       ClearSearch (null, null);
                }

                public void QuickSearch (string query)


I hope I'm submitting these correctly...

Thanks.




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