[banshee/gtk3] Refactor our SearchEntry widget to use new features of Gtk.Entry



commit 2702631b5649ed162f95b34b8c1513d40a250635
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Tue Dec 13 21:15:41 2011 +0100

    Refactor our SearchEntry widget to use new features of Gtk.Entry
    
    The standard GTK.Entry widget now supports primary and secondary icons,
    so we don't need to handle the search and clear icons by ourselves.
    
    SearchEntry is now derived directly from Gtk.Entry, and much simpler
    than the old composite widget. It only adds a few tweaks to match the
    behavior we want, and handles displaying the EmptyMessage. This also
    allows use to drop HoverImageButton.
    
    As a non-trivial side effect, this fixes the appearance of the
    widget with GTK+ 3.
    
    Adapt the various places using SearchEntry, simplifying where we can.

 src/Clients/Nereid/Nereid/PlayerInterface.cs       |    2 +-
 src/Clients/Nereid/Nereid/ViewContainer.cs         |    2 +-
 .../Banshee.Addins.Gui/AddinView.cs                |    2 +-
 .../Banshee.WebSource/WebBrowserShell.cs           |    7 +-
 src/Core/Banshee.Widgets/Banshee.Widgets.csproj    |    1 -
 .../Banshee.Widgets/HoverImageButton.cs            |  258 -------------
 .../Banshee.Widgets/Banshee.Widgets/SearchEntry.cs |  404 ++++++--------------
 src/Core/Banshee.Widgets/Makefile.am               |    1 -
 .../StoreWebBrowserShell.cs                        |    1 +
 .../Banshee.InternetArchive/HeaderFilters.cs       |    2 +-
 .../Banshee.InternetArchive/HomeView.cs            |    4 +-
 11 files changed, 132 insertions(+), 552 deletions(-)
---
diff --git a/src/Clients/Nereid/Nereid/PlayerInterface.cs b/src/Clients/Nereid/Nereid/PlayerInterface.cs
index 5d158ac..ea4414f 100644
--- a/src/Clients/Nereid/Nereid/PlayerInterface.cs
+++ b/src/Clients/Nereid/Nereid/PlayerInterface.cs
@@ -729,7 +729,7 @@ namespace Nereid
             var src = ServiceManager.SourceManager.ActiveSource;
             var search_entry = src.Properties.Get<SearchEntry> ("Nereid.SearchEntry") ?? view_container.SearchEntry;
             if (focus_search && search_entry.Visible && !source_view.EditingRow) {
-                search_entry.InnerEntry.GrabFocus ();
+                search_entry.GrabFocus ();
                 search_entry.HasFocus = true;
                 return true;
             }
diff --git a/src/Clients/Nereid/Nereid/ViewContainer.cs b/src/Clients/Nereid/Nereid/ViewContainer.cs
index 29df9bf..d2f6457 100644
--- a/src/Clients/Nereid/Nereid/ViewContainer.cs
+++ b/src/Clients/Nereid/Nereid/ViewContainer.cs
@@ -169,7 +169,7 @@ namespace Nereid
 
             search_entry.Query = String.IsNullOrEmpty (query) ? String.Empty : query + ":";
 
-            Editable editable = search_entry.InnerEntry as Editable;
+            Editable editable = search_entry as Editable;
             if (editable != null) {
                 editable.Position = search_entry.Query.Length;
             }
diff --git a/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs b/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
index 7709971..813936b 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
@@ -152,7 +152,7 @@ namespace Banshee.Addins.Gui
             PackStart (hbox, false, false, 0);
             PackStart (tree_scroll, true, true, 0);
             ShowAll ();
-            search_entry.InnerEntry.GrabFocus ();
+            search_entry.GrabFocus ();
 
             txt_cell.WrapWidth = 300;
         }
diff --git a/src/Core/Banshee.WebBrowser/Banshee.WebSource/WebBrowserShell.cs b/src/Core/Banshee.WebBrowser/Banshee.WebSource/WebBrowserShell.cs
index b7c5bed..b62ccc2 100644
--- a/src/Core/Banshee.WebBrowser/Banshee.WebSource/WebBrowserShell.cs
+++ b/src/Core/Banshee.WebBrowser/Banshee.WebSource/WebBrowserShell.cs
@@ -92,13 +92,8 @@ namespace Banshee.WebSource
                 AttachOptions.Shrink,
                 0, 0);
 
-            //search_entry.EmptyMessage = String.Format (Catalog.GetString ("Search the Amazon MP3 Store"));
             search_entry.SetSizeRequest (260, -1);
-            // FIXME: dummy option to make the "search" icon show up;
-            // we should probably fix this in the SearchEntry, but also
-            // add real filter options for searching Amazon MP3 (artist,
-            // album, genre, etc.)
-            search_entry.AddFilterOption (0, name);
+            search_entry.ShowSearchIcon = true;
             search_entry.Show ();
             search_entry.Activated += (o, e) => {
                 view.GoSearch (search_entry.Query);
diff --git a/src/Core/Banshee.Widgets/Banshee.Widgets.csproj b/src/Core/Banshee.Widgets/Banshee.Widgets.csproj
index 4614073..e2bdf58 100644
--- a/src/Core/Banshee.Widgets/Banshee.Widgets.csproj
+++ b/src/Core/Banshee.Widgets/Banshee.Widgets.csproj
@@ -76,7 +76,6 @@
     <Compile Include="Banshee.Widgets\DateButton.cs" />
     <Compile Include="Banshee.Widgets\DictionaryComboBox.cs" />
     <Compile Include="Banshee.Widgets\DiscUsageDisplay.cs" />
-    <Compile Include="Banshee.Widgets\HoverImageButton.cs" />
     <Compile Include="Banshee.Widgets\LinearProgress.cs" />
     <Compile Include="Banshee.Widgets\LinkLabel.cs" />
     <Compile Include="Banshee.Widgets\MessagePane.cs" />
diff --git a/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs b/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs
index dc11c42..7f066da 100644
--- a/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs
+++ b/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs
@@ -4,8 +4,10 @@
 // Author:
 //   Aaron Bockover <abockover novell com>
 //   Gabriel Burt <gburt novell com>
+//   Bertrand Lorentz <bertrand lorentz gmail com>
 //
-// Copyright (C) 2007 Novell, Inc.
+// Copyright 2007 Novell, Inc.
+// Copyright 2011 Bertrand Lorentz
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,13 +34,8 @@ using Gtk;
 
 namespace Banshee.Widgets
 {
-    public class SearchEntry : EventBox
+    public class SearchEntry : Entry
     {
-        private HBox box;
-        private Entry entry;
-        private HoverImageButton filter_button;
-        private HoverImageButton clear_button;
-
         private Menu menu;
         private int active_filter_id = -1;
 
@@ -50,16 +47,11 @@ namespace Banshee.Widgets
         private event EventHandler filter_changed;
         private event EventHandler entry_changed;
 
-        public event EventHandler Changed {
+        public new event EventHandler Changed {
             add { entry_changed += value; }
             remove { entry_changed -= value; }
         }
 
-        public event EventHandler Activated {
-            add { entry.Activated += value; }
-            remove { entry.Activated -= value; }
-        }
-
         public event EventHandler FilterChanged {
             add { filter_changed += value; }
             remove { filter_changed -= value; }
@@ -67,6 +59,8 @@ namespace Banshee.Widgets
 
         public uint ChangeTimeoutMs { get; set; }
 
+        public bool ShowSearchIcon { get; set; }
+
         public Menu Menu {
             get { return menu; }
         }
@@ -75,108 +69,55 @@ namespace Banshee.Widgets
         {
         }
 
-        public SearchEntry()
+        public SearchEntry () : base ()
         {
             ChangeTimeoutMs = 25;
-            AppPaintable = true;
-
-            BuildWidget();
-            BuildMenu();
 
-            NoShowAll = true;
-        }
-
-        private void BuildWidget()
-        {
-            box = new HBox();
-            entry = new FramelessEntry(this);
-            filter_button = new HoverImageButton(IconSize.Menu, new string [] { "edit-find", Stock.Find });
-            clear_button = new HoverImageButton(IconSize.Menu, new string [] { "edit-clear", Stock.Clear });
-            clear_button.TooltipText = Mono.Unix.Catalog.GetString ("Clear search");
-
-            box.PackStart(filter_button, false, false, 0);
-            box.PackStart(entry, true, true, 0);
-            box.PackStart(clear_button, false, false, 0);
-
-            Add(box);
-            box.ShowAll();
-
-            entry.StyleUpdated += OnInnerEntryStyleUpdated;
-            entry.StateChanged += OnInnerEntryStateChanged;
-            entry.FocusInEvent += OnInnerEntryFocusEvent;
-            entry.FocusOutEvent += OnInnerEntryFocusEvent;
-            entry.Changed += OnInnerEntryChanged;
-
-            filter_button.Image.Xpad = 2;
-            clear_button.Image.Xpad = 2;
-            filter_button.CanFocus = false;
-            clear_button.CanFocus = false;
-
-            filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
-            clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
-            clear_button.Clicked += OnClearButtonClicked;
-
-            filter_button.Visible = false;
-            clear_button.Visible = false;
-        }
-
-        private void BuildMenu()
-        {
-            menu = new Menu();
-            menu.Deactivated += OnMenuDeactivated;
+            menu = new Menu ();
         }
 
-        private void ShowMenu(uint time)
+        private void ShowMenu (uint time)
         {
-            if(menu.Children.Length > 0) {
-                menu.Popup(null, null, OnPositionMenu, 0, time);
-                menu.ShowAll();
+            if (menu.Children.Length > 0) {
+                menu.Popup (null, null, null, 0, time);
+                menu.ShowAll ();
             }
         }
 
-        private void ShowHideButtons()
+        private void ShowHideButtons ()
         {
-            clear_button.Visible = entry.Text.Length > 0;
-            filter_button.Visible = menu != null && menu.Children.Length > 0;
-        }
-
-        private void OnPositionMenu(Menu menu, out int x, out int y, out bool push_in)
-        {
-            int origin_x, origin_y, tmp;
-
-            filter_button.Window.GetOrigin(out origin_x, out tmp);
-            Window.GetOrigin(out tmp, out origin_y);
-
-            x = origin_x + filter_button.Allocation.X;
-            int minimum_height, natural_height;
-            GetPreferredHeight (out minimum_height, out natural_height);
-            y = origin_y + natural_height;
-            push_in = true;
-        }
-
-        private void OnMenuDeactivated(object o, EventArgs args)
-        {
-            filter_button.QueueDraw();
+            if (ShowSearchIcon || (menu != null && menu.Children.Length > 0)) {
+                SetIconFromIconName (EntryIconPosition.Primary, "edit-find");
+                PrimaryIconSensitive = PrimaryIconActivatable = true;
+            } else {
+                SetIconFromIconName (EntryIconPosition.Primary, null);
+            }
+            if (Text.Length > 0) {
+                SetIconFromIconName (EntryIconPosition.Secondary, "edit-clear");
+                SecondaryIconSensitive = SecondaryIconActivatable = true;
+            } else {
+                SetIconFromIconName (EntryIconPosition.Secondary, null);
+            }
         }
 
         private bool toggling = false;
 
-        private void OnMenuItemActivated(object o, EventArgs args)
+        private void OnMenuItemActivated (object o, EventArgs args)
         {
-            if(toggling || !(o is FilterMenuItem)) {
+            if (toggling || !(o is FilterMenuItem)) {
                 return;
             }
 
             toggling = true;
             FilterMenuItem item = (FilterMenuItem)o;
 
-            foreach(MenuItem child_item in menu) {
-                if(!(child_item is FilterMenuItem)) {
+            foreach (MenuItem child_item in menu) {
+                if (!(child_item is FilterMenuItem)) {
                     continue;
                 }
 
                 FilterMenuItem filter_child = (FilterMenuItem)child_item;
-                if(filter_child != item) {
+                if (filter_child != item) {
                     filter_child.Active = false;
                 }
             }
@@ -186,160 +127,147 @@ namespace Banshee.Widgets
             toggling = false;
         }
 
-        private void OnInnerEntryChanged(object o, EventArgs args)
+        protected override void OnChanged ()
         {
-            ShowHideButtons();
+            ShowHideButtons ();
 
-            if(changed_timeout_id > 0) {
-                GLib.Source.Remove(changed_timeout_id);
+            if (changed_timeout_id > 0) {
+                GLib.Source.Remove (changed_timeout_id);
             }
 
-            if (Ready)
-                changed_timeout_id = GLib.Timeout.Add(ChangeTimeoutMs, OnChangedTimeout);
-        }
-
-        private bool OnChangedTimeout()
-        {
-            OnChanged();
-            return false;
+            if (Ready) {
+                changed_timeout_id = GLib.Timeout.Add (ChangeTimeoutMs, OnChangedTimeout);
+            }
         }
 
-        private void UpdateStyle ()
+        private bool OnChangedTimeout ()
         {
-            var color = entry.StyleContext.GetBackgroundColor (entry.StateFlags);
-            filter_button.OverrideBackgroundColor (entry.StateFlags, color);
-            clear_button.OverrideBackgroundColor (entry.StateFlags, color);
-            box.BorderWidth = (uint)entry.StyleContext.GetPadding (StateFlags).Left;
-        }
+            if (!Ready) {
+                return false;
+            }
 
-        private void OnInnerEntryStyleUpdated (object o, EventArgs args)
-        {
-            UpdateStyle ();
-        }
+            EventHandler handler = entry_changed;
+            if (handler != null) {
+                handler (this, EventArgs.Empty);
+            }
 
-        private void OnInnerEntryStateChanged (object o, EventArgs args)
-        {
-            UpdateStyle ();
+            return false;
         }
 
-        private void OnInnerEntryFocusEvent(object o, EventArgs args)
+        protected override void OnIconPress (EntryIconPosition icon_pos, Gdk.Event evnt)
         {
-            QueueDraw();
-        }
+            var evnt_button = evnt as Gdk.EventButton;
+            if (evnt_button == null) {
+                return;
+            }
 
-        private void OnButtonReleaseEvent(object o, ButtonReleaseEventArgs args)
-        {
-            if(args.Event.Button != 1) {
+            if (evnt_button.Button != 1) {
                 return;
             }
 
-            entry.HasFocus = true;
+            HasFocus = true;
 
-            if(o == filter_button) {
-                ShowMenu(args.Event.Time);
+            if (icon_pos == EntryIconPosition.Primary) {
+                ShowMenu (evnt_button.Time);
+            } else if (icon_pos == EntryIconPosition.Secondary) {
+                active_filter_id = 0;
+                Text = String.Empty;
             }
         }
 
-        private void OnClearButtonClicked(object o, EventArgs args)
-        {
-            active_filter_id = 0;
-            entry.Text = String.Empty;
-        }
-
         protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
         {
             if (evnt.Key == Gdk.Key.Escape) {
                 active_filter_id = 0;
-                entry.Text = String.Empty;
+                Text = String.Empty;
                 return true;
             }
             return base.OnKeyPressEvent (evnt);
         }
 
-        protected override bool OnDrawn (Cairo.Context cr)
+        protected override void OnShown ()
         {
-            StyleContext.Save ();
-            StyleContext.AddClass ("entry");
-            StyleContext.RenderFrame (cr, 0, 0, Allocation.Width, Allocation.Height);
-            StyleContext.RenderBackground (cr, 0, 0, Allocation.Width, Allocation.Height);
-            PropagateDraw (Child, cr);
-            StyleContext.Restore ();
-
-            return true;
+            base.OnShown ();
+            ShowHideButtons ();
         }
 
-        protected override void OnShown()
+        // TODO: GTK+ 3.2 adds a placeholder-text property, but for now
+        // we have to handle it ourselves
+        protected override bool OnDrawn (Cairo.Context cr)
         {
-            base.OnShown();
-            ShowHideButtons();
-        }
+            bool ret = base.OnDrawn (cr);
 
-        protected virtual void OnChanged()
-        {
-            if(!Ready) {
-                return;
+            if(Text.Length > 0 || HasFocus || EmptyMessage == null) {
+                return ret;
             }
 
-            EventHandler handler = entry_changed;
-            if(handler != null) {
-                handler(this, EventArgs.Empty);
+            Layout.SetMarkup (EmptyMessage);
+
+            Gdk.RGBA color;
+            if (!StyleContext.LookupColor ("placeholder_text_color", out color)) {
+                color = StyleContext.GetColor (StateFlags.Insensitive);
             }
+            Pango.Attribute attr = new Pango.AttrForeground (Convert.ToUInt16 (color.Red * 65535),
+                Convert.ToUInt16 (color.Green * 65535), Convert.ToUInt16 (color.Blue * 65535));
+            Layout.Attributes.Insert (attr);
+
+            return ret;
         }
 
-        protected virtual void OnFilterChanged()
+        protected virtual void OnFilterChanged ()
         {
             EventHandler handler = filter_changed;
-            if(handler != null) {
-                handler(this, EventArgs.Empty);
+            if (handler != null) {
+                handler (this, EventArgs.Empty);
             }
 
-            if(IsQueryAvailable) {
-                OnInnerEntryChanged(this, EventArgs.Empty);
+            if (IsQueryAvailable) {
+                OnChanged ();
             }
         }
 
-        public void AddFilterOption(int id, string label)
+        public void AddFilterOption (int id, string label)
         {
-            if(id < 0) {
-                throw new ArgumentException("id", "must be >= 0");
+            if (id < 0) {
+                throw new ArgumentException ("id", "must be >= 0");
             }
 
-            FilterMenuItem item = new FilterMenuItem(id, label);
+            FilterMenuItem item = new FilterMenuItem (id, label);
             item.Activated += OnMenuItemActivated;
-            menu.Append(item);
+            menu.Append (item);
 
-            if(ActiveFilterID < 0) {
-                item.Activate();
+            if (ActiveFilterID < 0) {
+                item.Activate ();
             }
 
-            filter_button.Visible = true;
+            SetIconSensitive (EntryIconPosition.Primary, true);
         }
 
-        public void AddFilterSeparator()
+        public void AddFilterSeparator ()
         {
-            menu.Append(new SeparatorMenuItem());
+            menu.Append (new SeparatorMenuItem ());
         }
 
-        public void RemoveFilterOption(int id)
+        public void RemoveFilterOption (int id)
         {
-            FilterMenuItem item = FindFilterMenuItem(id);
-            if(item != null) {
-                menu.Remove(item);
+            FilterMenuItem item = FindFilterMenuItem (id);
+            if (item != null) {
+                menu.Remove (item);
             }
         }
 
-        public void ActivateFilter(int id)
+        public void ActivateFilter (int id)
         {
-            FilterMenuItem item = FindFilterMenuItem(id);
-            if(item != null) {
-                item.Activate();
+            FilterMenuItem item = FindFilterMenuItem (id);
+            if (item != null) {
+                item.Activate ();
             }
         }
 
-        private FilterMenuItem FindFilterMenuItem(int id)
+        private FilterMenuItem FindFilterMenuItem (int id)
         {
-            foreach(MenuItem item in menu) {
-                if(item is FilterMenuItem && ((FilterMenuItem)item).ID == id) {
+            foreach (MenuItem item in menu) {
+                if (item is FilterMenuItem && ((FilterMenuItem)item).ID == id) {
                     return (FilterMenuItem)item;
                 }
             }
@@ -347,47 +275,47 @@ namespace Banshee.Widgets
             return null;
         }
 
-        public string GetLabelForFilterID(int id)
+        public string GetLabelForFilterID (int id)
         {
-            FilterMenuItem item = FindFilterMenuItem(id);
-            if(item == null) {
+            FilterMenuItem item = FindFilterMenuItem (id);
+            if (item == null) {
                 return null;
             }
 
             return item.Label;
         }
 
-        public void CancelSearch()
+        public void CancelSearch ()
         {
-            entry.Text = String.Empty;
-            ActivateFilter(0);
+            Text = String.Empty;
+            ActivateFilter (0);
         }
 
         public int ActiveFilterID {
             get { return active_filter_id; }
             private set {
-                if(value == active_filter_id) {
+                if (value == active_filter_id) {
                     return;
                 }
 
                 active_filter_id = value;
-                OnFilterChanged();
+                OnFilterChanged ();
             }
         }
 
         public string EmptyMessage {
             get {
-                return entry.Sensitive ? empty_message : String.Empty;
+                return Sensitive ? empty_message : String.Empty;
             }
             set {
                 empty_message = value;
-                entry.QueueDraw();
+                QueueDraw ();
             }
         }
 
         public string Query {
-            get { return entry.Text.Trim(); }
-            set { entry.Text = String.IsNullOrEmpty (value) ? String.Empty : value.Trim (); }
+            get { return Text.Trim (); }
+            set { Text = String.IsNullOrEmpty (value) ? String.Empty : value.Trim (); }
         }
 
         public bool IsQueryAvailable {
@@ -399,113 +327,29 @@ namespace Banshee.Widgets
             set { ready = value; }
         }
 
-        public new bool HasFocus {
-            get { return entry.HasFocus; }
-            set { entry.HasFocus = true; }
-        }
-
-
-        public Entry InnerEntry {
-            get { return entry; }
-        }
-
         protected override void OnStateChanged (Gtk.StateType previous_state)
         {
             base.OnStateChanged (previous_state);
 
-            entry.Sensitive = State != StateType.Insensitive;
-            filter_button.Sensitive = State != StateType.Insensitive;
-            clear_button.Sensitive = State != StateType.Insensitive;
+            Sensitive = State != StateType.Insensitive;
         }
 
-        private class FilterMenuItem : MenuItem /*CheckMenuItem*/
+        private class FilterMenuItem : CheckMenuItem
         {
             private int id;
 
-            public FilterMenuItem(int id, string label) : base(label)
+            public FilterMenuItem (int id, string label) : base(label)
             {
                 this.id = id;
-                //DrawAsRadio = true;
+                DrawAsRadio = true;
             }
 
-            protected FilterMenuItem(IntPtr ptr) : base (ptr) {}
-
-            public int ID {
-                get { return id; }
-            }
-
-            // FIXME: Remove when restored to CheckMenuItem
-            private bool active;
-            public bool Active {
-                get { return active; }
-                set { active = value; }
-            }
-
-            public event EventHandler Toggled;
-            protected override void OnActivated ()
+            protected FilterMenuItem (IntPtr ptr) : base (ptr)
             {
-                base.OnActivated ();
-                if (Toggled != null) {
-                    Toggled (this, EventArgs.Empty);
-                }
             }
 
-        }
-
-        private class FramelessEntry : Entry
-        {
-            private SearchEntry parent;
-            private Pango.Layout layout;
- 
-            public FramelessEntry(SearchEntry parent) : base()
-            {
-                this.parent = parent;
-                HasFrame = false;
-
-                parent.StyleUpdated += OnParentStyleUpdated;
-                WidthChars = 1;
-            }
-
-            private void OnParentStyleUpdated (object o, EventArgs args)
-            {
-                QueueDraw();
-            }
-
-            protected override bool OnDrawn (Cairo.Context cr)
-            {
-                // The Entry's Window is the top level window onto which
-                // the frame is drawn; the actual text entry is drawn into a
-                // separate window, so we can ensure that for themes that don't
-                // respect HasFrame, we never ever allow the base frame drawing
-                // to happen
-                if (!CairoHelper.ShouldDrawWindow (cr, Window)) {
-                    return true;
-                }
-
-                bool ret = base.OnDrawn (cr);
-
-                if(Text.Length > 0 || HasFocus || parent.EmptyMessage == null) {
-                    return ret;
-                }
-
-                StyleContext.Save ();
-                //use entry class to have free theming
-                StyleContext.AddClass ("entry");
-                StyleContext.State = StateFlags.Insensitive ;
-
-                if (layout == null) {
-                    layout = new Pango.Layout(PangoContext);
-                    layout.FontDescription = PangoContext.FontDescription;
-                }
-
-                int width, height;
-                layout.SetMarkup(parent.EmptyMessage);
-                layout.GetPixelSize(out width, out height);
-                int minimum_height, natural_height;
-                OnGetPreferredHeight (out minimum_height, out natural_height);
-                StyleContext.RenderLayout (cr, 2, (natural_height - height) / 2, layout);
-                StyleContext.Restore ();
-                return ret;
+            public int ID {
+                get { return id; }
             }
         }
     }
diff --git a/src/Core/Banshee.Widgets/Makefile.am b/src/Core/Banshee.Widgets/Makefile.am
index a752190..032dc78 100644
--- a/src/Core/Banshee.Widgets/Makefile.am
+++ b/src/Core/Banshee.Widgets/Makefile.am
@@ -7,7 +7,6 @@ SOURCES =  \
 	Banshee.Widgets/DateButton.cs \
 	Banshee.Widgets/DictionaryComboBox.cs \
 	Banshee.Widgets/DiscUsageDisplay.cs \
-	Banshee.Widgets/HoverImageButton.cs \
 	Banshee.Widgets/LinearProgress.cs \
 	Banshee.Widgets/LinkLabel.cs \
 	Banshee.Widgets/MenuTile.cs \
diff --git a/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreWebBrowserShell.cs b/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreWebBrowserShell.cs
index b9362be..189c396 100644
--- a/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreWebBrowserShell.cs
+++ b/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreWebBrowserShell.cs
@@ -40,6 +40,7 @@ namespace Banshee.AmazonMp3.Store
         {
             StoreView = store_view;
 
+            // TODO: Add real filter options for searching Amazon MP3 (artist, album, genre, etc.)
             SearchEntry.EmptyMessage = String.Format (Catalog.GetString ("Search the Amazon MP3 Store"));
 
             NavigationControl.AddLink (Catalog.GetString ("How Your Purchases Support GNOME"), StoreView.GetActionUrl ("about/"));
diff --git a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs
index 7048370..70e182d 100644
--- a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs
+++ b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs
@@ -144,7 +144,7 @@ namespace Banshee.InternetArchive
                 string prev_query = entry.Query.EndsWith (":") ? null : entry.Query;
                 entry.Query = String.Format ("{0}:{1}", filter_fields[entry.ActiveFilterID].Id, prev_query);
 
-                var editable = entry.InnerEntry as Editable;
+                var editable = entry as Editable;
                 if (editable != null) {
                     editable.Position = entry.Query.Length;
                 }
diff --git a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HomeView.cs b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HomeView.cs
index b8d7d11..cd7fcec 100644
--- a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HomeView.cs
+++ b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HomeView.cs
@@ -103,9 +103,9 @@ namespace Banshee.InternetArchive
             source.Properties.Set<SearchEntry> ("Nereid.SearchEntry", entry);
 
             // Make the search entry text nice and big
-            var font = entry.InnerEntry.StyleContext.GetFont (StateFlags.Normal).Copy ();
+            var font = entry.StyleContext.GetFont (StateFlags.Normal).Copy ();
             font.Size = (int) (font.Size * Pango.Scale.XLarge);
-            entry.InnerEntry.OverrideFont (font);
+            entry.OverrideFont (font);
             font.Dispose ();
 
             var button = new Hyena.Widgets.ImageButton (Catalog.GetString ("_Go"), Stock.Find);



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