[banshee] Nereid: make Search textbox remember its size (bgo#653819)



commit 4931c7fc1e6ecf242c7d0de661b226efcc37be46
Author: Tomasz Maczyński <tmtimon gmail com>
Date:   Wed May 22 23:21:59 2013 +0100

    Nereid: make Search textbox remember its size (bgo#653819)
    
    Adding a new SchemaEntry<int> to PlayerInterface class that will store
    the size of the SearchEntry widget.
    
    Signed-off-by: Andres G. Aragoneses <knocte gmail com>

 src/Clients/Nereid/Nereid/PlayerInterface.cs |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/Clients/Nereid/Nereid/PlayerInterface.cs b/src/Clients/Nereid/Nereid/PlayerInterface.cs
index 60d7215..52fb337 100644
--- a/src/Clients/Nereid/Nereid/PlayerInterface.cs
+++ b/src/Clients/Nereid/Nereid/PlayerInterface.cs
@@ -170,7 +170,18 @@ namespace Nereid
             search_entry_align = new Alignment (1.0f, 0.5f, 0f, 0f);
             var box = new HBox () { Spacing = 2 };
             var grabber = new GrabHandle ();
-            grabber.ControlWidthOf (view_container.SearchEntry, 150, 350, false);
+            var search_entry = view_container.SearchEntry;
+            grabber.ControlWidthOf (search_entry, 150, 350, false);
+
+            int search_entry_width = SearchEntryWidth.Get ();
+
+            // -1 indicates that height should be preserved
+            search_entry.SetSizeRequest (search_entry_width, -1);
+
+            search_entry.SizeAllocated += (o, a) => {
+                SearchEntryWidth.Set (search_entry.Allocation.Width);
+            };
+
             box.PackStart (grabber, false, false, 0);
             box.PackStart (view_container.SearchEntry, false, false, 0);
             search_entry_align.Child = box;
@@ -807,6 +818,11 @@ namespace Nereid
             175, "Width of seek slider in px", ""
         );
 
+        private static readonly SchemaEntry<int> SearchEntryWidth = new SchemaEntry<int> (
+            "player_window", "search_entry_width",
+            200, "Width of search entry element in px", ""
+        );
+
 #endregion
 
         IDBusExportable IDBusExportable.Parent {


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