banshee r4192 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Extensions/Banshee.MiniMode/Banshee.MiniMode src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea



Author: abock
Date: Tue Jun 24 18:04:22 2008
New Revision: 4192
URL: http://svn.gnome.org/viewvc/banshee?rev=4192&view=rev

Log:
2008-06-24  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs:
    * src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs:
    Split out layout rendering and event logic from TrackInfoDisplay,
    which is now abstract, into ClassicTrackInfoDisplay so the widget is 
    now easier to maintain and also new displays can be built by extending  
    TrackInfoDisplay - the extending class only has to worry about 
    rendering frames (no animation, group, xfade, etc.)

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs:
    * src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs:
    * src/Clients/Nereid/Nereid/PlayerInterface.cs:
    Updated to use ClassicTrackInfoDisplay



Added:
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
   trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
   trunk/banshee/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	Tue Jun 24 18:04:22 2008
@@ -154,7 +154,7 @@
             seek_slider.Show ();
             ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);
             
-            TrackInfoDisplay track_info_display = new TrackInfoDisplay ();
+            TrackInfoDisplay track_info_display = new ClassicTrackInfoDisplay ();
             track_info_display.Show ();
             ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_display, true);
             

Added: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs	Tue Jun 24 18:04:22 2008
@@ -0,0 +1,308 @@
+//
+// ClassicTrackInfoDisplay.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2007-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gdk;
+using Gtk;
+using Cairo;
+
+using Hyena.Gui;
+using Banshee.Collection;
+using Banshee.Collection.Gui;
+
+namespace Banshee.Gui.Widgets
+{
+    public class ClassicTrackInfoDisplay : TrackInfoDisplay
+    {
+        private Gdk.Window event_window;
+        
+        private ArtworkPopup popup;
+        private uint popup_timeout_id;
+        private bool in_popup;
+        private bool in_thumbnail_region;
+        
+        public override void Dispose ()
+        {
+            base.Dispose ();
+            HidePopup ();
+        }
+        
+#region Widget Window Management
+        
+        protected override void OnRealized ()
+        {
+            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;
+            GdkWindow = Parent.GdkWindow;
+            
+            WindowAttr attributes = new WindowAttr ();
+            attributes.WindowType = Gdk.WindowType.Child;
+            attributes.X = Allocation.X;
+            attributes.Y = Allocation.Y;
+            attributes.Width = Allocation.Width;
+            attributes.Height = Allocation.Height;
+            attributes.Wclass = WindowClass.InputOnly;
+            attributes.EventMask = (int)(
+                EventMask.PointerMotionMask |
+                EventMask.EnterNotifyMask |
+                EventMask.LeaveNotifyMask |
+                EventMask.ExposureMask);
+            
+            WindowAttributesType attributes_mask =
+                WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;
+            
+            event_window = new Gdk.Window (GdkWindow, attributes, attributes_mask);
+            event_window.UserData = Handle;
+            
+            base.OnRealized ();
+        }
+        
+        protected override void OnUnrealized ()
+        {
+            WidgetFlags ^= WidgetFlags.Realized;
+            
+            event_window.UserData = IntPtr.Zero;
+            event_window.Destroy ();
+            event_window = null;
+            
+            base.OnUnrealized ();
+        }
+        
+        protected override void OnMapped ()
+        {
+            event_window.Show ();
+            base.OnMapped ();
+        }
+
+        protected override void OnUnmapped ()
+        {
+            event_window.Hide ();
+            base.OnUnmapped ();
+        }
+        
+        protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+        {
+            base.OnSizeAllocated (allocation);
+            
+            if (IsRealized) {
+                event_window.MoveResize (allocation);
+            }
+        }
+        
+        protected override void OnSizeRequested (ref Requisition requisition)
+        {
+            requisition.Height = ComputeWidgetHeight ();
+        }
+        
+        private int ComputeWidgetHeight ()
+        {
+            int width, height;
+            Pango.Layout layout = new Pango.Layout (PangoContext);
+            layout.SetText ("W");
+            layout.GetPixelSize (out width, out height);
+            layout.Dispose ();
+            return 2 * height;
+        }
+
+#endregion
+        
+#region Drawing
+        
+        protected override void RenderTrackInfo (Context cr, TrackInfo track, bool renderTrack, bool renderArtistAlbum)
+        {
+            if (track == null) {
+                return;
+            }
+            
+            double offset = Allocation.Height + 10, y = 0;
+            double x = Allocation.X + offset;
+            double width = Allocation.Width - offset;
+            int fl_width, fl_height, sl_width, sl_height;
+
+            // Set up the text layouts
+            Pango.Layout first_line_layout = null;
+            CairoExtensions.CreateLayout (this, cr, ref first_line_layout);
+            first_line_layout.Width = (int)(width * Pango.Scale.PangoScale);
+            first_line_layout.Ellipsize = Pango.EllipsizeMode.End;
+                        
+            Pango.Layout second_line_layout = first_line_layout.Copy ();
+            
+            // Compute the layout coordinates
+            first_line_layout.SetMarkup (GetFirstLineText (track));
+            first_line_layout.GetPixelSize (out fl_width, out fl_height);
+            second_line_layout.SetMarkup (GetSecondLineText (track));
+            second_line_layout.GetPixelSize (out sl_width, out sl_height);
+            
+            if (fl_height + sl_height > Allocation.Height) {
+                SetSizeRequest (-1, fl_height + sl_height);
+            }
+            
+            y = Allocation.Y + (Allocation.Height - (fl_height + sl_height)) / 2;
+            
+            // Render the layouts
+            cr.Antialias = Cairo.Antialias.Default;
+            
+            if (renderTrack) {
+                cr.MoveTo (x, y);
+                cr.Color = TextColor;
+                PangoCairoHelper.ShowLayout (cr, first_line_layout);
+            }
+
+            if (!renderArtistAlbum) {
+                first_line_layout.Dispose ();
+                second_line_layout.Dispose ();
+                return;
+            }
+            
+            cr.MoveTo (x, y + fl_height);
+            PangoCairoHelper.ShowLayout (cr, second_line_layout);
+            
+            first_line_layout.Dispose ();
+            second_line_layout.Dispose ();
+        }
+        
+#endregion
+
+#region Interaction Events
+
+        protected override bool OnEnterNotifyEvent (EventCrossing evnt)
+        {
+            in_thumbnail_region = evnt.X <= Allocation.Height;
+            return ShowHideCoverArt ();
+        }
+        
+        protected override bool OnLeaveNotifyEvent (EventCrossing evnt)
+        {
+            in_thumbnail_region = false;
+            return ShowHideCoverArt ();
+        }
+        
+        protected override bool OnMotionNotifyEvent (EventMotion evnt)
+        {
+            in_thumbnail_region = evnt.X <= Allocation.Height;
+            return ShowHideCoverArt ();
+        }
+        
+        private void OnPopupEnterNotifyEvent (object o, EnterNotifyEventArgs args)
+        {
+            in_popup = true;
+        }
+        
+        private void OnPopupLeaveNotifyEvent (object o, LeaveNotifyEventArgs args)
+        {
+            in_popup = false;
+            HidePopup ();
+        }
+        
+        private bool ShowHideCoverArt ()
+        {
+            if (!in_thumbnail_region) {
+                if (popup_timeout_id > 0) {
+                    GLib.Source.Remove (popup_timeout_id);
+                    popup_timeout_id = 0;
+                }
+                
+                GLib.Timeout.Add (100, delegate {
+                    if (!in_popup) {
+                        HidePopup ();
+                    }
+
+                    return false;
+                });
+            } else {
+                if (popup_timeout_id > 0) {
+                    return false;
+                }
+                
+                popup_timeout_id = GLib.Timeout.Add (500, delegate {
+                    if (in_thumbnail_region) {
+                        UpdatePopup ();
+                    }
+                    
+                    popup_timeout_id = 0;
+                    return false;
+                });
+            }
+            
+            return true;
+        }
+
+#endregion
+
+#region Popup Window
+
+        protected override void OnArtworkChanged ()
+        {
+            UpdatePopup ();
+        }
+
+        private bool UpdatePopup ()
+        {
+            if (CurrentTrack == null || ArtworkManager == null) {
+                HidePopup ();
+                return false;
+            }
+            
+            Gdk.Pixbuf pixbuf = ArtworkManager.Lookup (CurrentTrack.ArtworkId);
+         
+            if (pixbuf == null) {
+                HidePopup ();
+                return false;
+            }
+            
+            if (popup == null) {
+                popup = new ArtworkPopup ();
+                popup.EnterNotifyEvent += OnPopupEnterNotifyEvent;
+                popup.LeaveNotifyEvent += OnPopupLeaveNotifyEvent;
+            }
+            
+            popup.Label = String.Format ("{0} - {1}", CurrentTrack.DisplayArtistName, 
+                CurrentTrack.DisplayAlbumTitle);
+            popup.Image = pixbuf;
+                
+            if (in_thumbnail_region) {
+                popup.Show ();
+            }
+            
+            return true;
+        }
+        
+        private void HidePopup ()
+        {
+            if (popup != null) {
+                ArtworkRenderer.DisposePixbuf (popup.Image);
+                popup.Destroy ();
+                popup.EnterNotifyEvent -= OnPopupEnterNotifyEvent;
+                popup.LeaveNotifyEvent -= OnPopupLeaveNotifyEvent;
+                popup = null;
+            }
+        }
+        
+#endregion
+
+    }
+}

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	Tue Jun 24 18:04:22 2008
@@ -46,30 +46,60 @@
 
 namespace Banshee.Gui.Widgets
 {
-    public class TrackInfoDisplay : Widget
+    public abstract class TrackInfoDisplay : Widget
     {
-        private Gdk.Window event_window;
-        
         private ArtworkManager artwork_manager;
+        protected ArtworkManager ArtworkManager {
+            get { return artwork_manager; }
+        }
+        
         private Pixbuf current_pixbuf;
+        protected Pixbuf CurrentPixbuf {
+            get { return current_pixbuf; }
+        }
+        
         private Pixbuf incoming_pixbuf;
+        protected Pixbuf IncomingPixbuf {
+            get { return incoming_pixbuf; }
+        }
+        
         private Pixbuf missing_audio_pixbuf;
+        protected Pixbuf MissingAudioPixbuf {
+            get { return missing_audio_pixbuf; }
+        }
+        
         private Pixbuf missing_video_pixbuf;
+        protected Pixbuf MissingVideoPixbuf {
+            get { return missing_video_pixbuf; }
+        }
         
         private Cairo.Color background_color;
+        protected Cairo.Color BackgroundColor {
+            get { return background_color; }
+        }
+        
         private Cairo.Color text_color;
+        protected Cairo.Color TextColor {
+            get { return text_color; }
+        }
+        
         private Cairo.Color text_light_color;
+        protected Cairo.Color TextLightColor {
+            get { return text_light_color; }
+        }
         
         private TrackInfo current_track;
-        private TrackInfo incoming_track;        
-
-        private SingleActorStage stage = new SingleActorStage ();
+        protected TrackInfo CurrentTrack {
+            get { return current_track; }
+        }
+        
+        private TrackInfo incoming_track;   
+        protected TrackInfo IncomingTrack {
+            get { return incoming_track; }
+        }
         
-        private ArtworkPopup popup;
-        private uint popup_timeout_id;
-        private uint idle_timeout_id;
-        private bool in_popup;
-        private bool in_thumbnail_region;
+        private uint idle_timeout_id = 0;
+        private SingleActorStage stage = new SingleActorStage ();
         
         protected TrackInfoDisplay (IntPtr native) : base (native)
         {
@@ -79,8 +109,8 @@
         {
             stage.Iteration += OnStageIteration;
         
-            if (ServiceManager.Contains ("ArtworkManager")) {
-                artwork_manager = ServiceManager.Get<ArtworkManager> ("ArtworkManager");
+            if (ServiceManager.Contains<ArtworkManager> ()) {
+                artwork_manager = ServiceManager.Get<ArtworkManager> ();
             }
             
             ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent, 
@@ -102,160 +132,17 @@
             stage.Iteration -= OnStageIteration;
             stage = null;
             
-            HidePopup ();
-            
             base.Dispose ();
         }
-
-#region Widget Window Management
-        
-        protected override void OnRealized ()
-        {
-            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;
-            GdkWindow = Parent.GdkWindow;
-            
-            WindowAttr attributes = new WindowAttr ();
-            attributes.WindowType = Gdk.WindowType.Child;
-            attributes.X = Allocation.X;
-            attributes.Y = Allocation.Y;
-            attributes.Width = Allocation.Width;
-            attributes.Height = Allocation.Height;
-            attributes.Wclass = WindowClass.InputOnly;
-            attributes.EventMask = (int)(
-                EventMask.PointerMotionMask |
-                EventMask.EnterNotifyMask |
-                EventMask.LeaveNotifyMask |
-                EventMask.ExposureMask);
-            
-            WindowAttributesType attributes_mask =
-                WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;
-            
-            event_window = new Gdk.Window (GdkWindow, attributes, attributes_mask);
-            event_window.UserData = Handle;
-            
-            base.OnRealized ();
-        }
         
-        protected override void OnUnrealized ()
-        {
-            WidgetFlags ^= WidgetFlags.Realized;
-            
-            event_window.UserData = IntPtr.Zero;
-            event_window.Destroy ();
-            event_window = null;
-            
-            base.OnUnrealized ();
-        }
-        
-        protected override void OnMapped ()
-        {
-            event_window.Show ();
-            base.OnMapped ();
-        }
-
-        protected override void OnUnmapped ()
-        {
-            event_window.Hide ();
-            base.OnUnmapped ();
-        }
-        
-        protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+        protected override void OnSizeAllocated (Rectangle allocation)
         {
             base.OnSizeAllocated (allocation);
             
-            if (IsRealized) {
-                event_window.MoveResize (allocation);
-            }
-            
             if (current_track == null) {
                 LoadCurrentTrack ();
             }
         }
-        
-        protected override void OnSizeRequested (ref Requisition requisition)
-        {
-            requisition.Height = ComputeWidgetHeight ();
-        }
-        
-        private int ComputeWidgetHeight ()
-        {
-            int width, height;
-            Pango.Layout layout = new Pango.Layout (PangoContext);
-            layout.SetText ("W");
-            layout.GetPixelSize (out width, out height);
-            layout.Dispose ();
-            return 2 * height;
-        }
-
-#endregion
-
-#region Interaction Events
-
-        protected override bool OnEnterNotifyEvent (EventCrossing evnt)
-        {
-            in_thumbnail_region = evnt.X <= Allocation.Height;
-            return ShowHideCoverArt ();
-        }
-        
-        protected override bool OnLeaveNotifyEvent (EventCrossing evnt)
-        {
-            in_thumbnail_region = false;
-            return ShowHideCoverArt ();
-        }
-        
-        protected override bool OnMotionNotifyEvent (EventMotion evnt)
-        {
-            in_thumbnail_region = evnt.X <= Allocation.Height;
-            return ShowHideCoverArt ();
-        }
-        
-        private void OnPopupEnterNotifyEvent (object o, EnterNotifyEventArgs args)
-        {
-            in_popup = true;
-        }
-        
-        private void OnPopupLeaveNotifyEvent (object o, LeaveNotifyEventArgs args)
-        {
-            in_popup = false;
-            HidePopup ();
-        }
-        
-        private bool ShowHideCoverArt ()
-        {
-            if (!in_thumbnail_region) {
-                if (popup_timeout_id > 0) {
-                    GLib.Source.Remove (popup_timeout_id);
-                    popup_timeout_id = 0;
-                }
-                
-                GLib.Timeout.Add (100, delegate {
-                    if (!in_popup) {
-                        HidePopup ();
-                    }
-
-                    return false;
-                });
-            } else {
-                if (popup_timeout_id > 0) {
-                    return false;
-                }
-                
-                popup_timeout_id = GLib.Timeout.Add (500, delegate {
-                    if (in_thumbnail_region) {
-                        UpdatePopup ();
-                    }
-                    
-                    popup_timeout_id = 0;
-                    return false;
-                });
-            }
-            
-            return true;
-        }
-
-#endregion
-        
-#region Drawing
 
         protected override void OnStyleSet (Style previous)
         {
@@ -349,69 +236,18 @@
             RenderTrackInfo (cr, track, true, true);
         }
         
-        private void RenderCoverArt (Cairo.Context cr, Pixbuf pixbuf)
+        protected virtual void RenderCoverArt (Cairo.Context cr, Pixbuf pixbuf)
         {
             ArtworkRenderer.RenderThumbnail (cr, pixbuf, false, Allocation.X, Allocation.Y, Allocation.Height, Allocation.Height, 
                 !IsMissingPixbuf (pixbuf), 0, IsMissingPixbuf (pixbuf), background_color);
         }
 
-        private bool IsMissingPixbuf (Pixbuf pb)
+        protected bool IsMissingPixbuf (Pixbuf pb)
         {
             return (pb == missing_audio_pixbuf || pb == missing_video_pixbuf);
         }
         
-        private void RenderTrackInfo (Cairo.Context cr, TrackInfo track, bool renderTrack, bool renderArtistAlbum)
-        {
-            if (track == null) {
-                return;
-            }
-            
-            double offset = Allocation.Height + 10, y = 0;
-            double x = Allocation.X + offset;
-            double width = Allocation.Width - offset;
-            int fl_width, fl_height, sl_width, sl_height;
-
-            // Set up the text layouts
-            Pango.Layout first_line_layout = null;
-            CairoExtensions.CreateLayout (this, cr, ref first_line_layout);
-            first_line_layout.Width = (int)(width * Pango.Scale.PangoScale);
-            first_line_layout.Ellipsize = Pango.EllipsizeMode.End;
-                        
-            Pango.Layout second_line_layout = first_line_layout.Copy ();
-            
-            // Compute the layout coordinates
-            first_line_layout.SetMarkup (GetFirstLineText (track));
-            first_line_layout.GetPixelSize (out fl_width, out fl_height);
-            second_line_layout.SetMarkup (GetSecondLineText (track));
-            second_line_layout.GetPixelSize (out sl_width, out sl_height);
-            
-            if (fl_height + sl_height > Allocation.Height) {
-                SetSizeRequest (-1, fl_height + sl_height);
-            }
-            
-            y = Allocation.Y + (Allocation.Height - (fl_height + sl_height)) / 2;
-            
-            // Render the layouts
-            cr.Antialias = Cairo.Antialias.Default;
-            
-            if (renderTrack) {
-                cr.MoveTo (x, y);
-                cr.Color = text_color;
-                PangoCairoHelper.ShowLayout (cr, first_line_layout);
-            }
-
-            if (!renderArtistAlbum) {
-                first_line_layout.Dispose ();
-                second_line_layout.Dispose ();
-                return;
-            }
-            
-            cr.MoveTo (x, y + fl_height);
-            PangoCairoHelper.ShowLayout (cr, second_line_layout);
-            
-            first_line_layout.Dispose ();
-            second_line_layout.Dispose ();
-        }
+        protected abstract void RenderTrackInfo (Cairo.Context cr, TrackInfo track, bool renderTrack, bool renderArtistAlbum);
         
         private void OnPlayerEvent (PlayerEventArgs args)
         {
@@ -506,15 +342,19 @@
             
             incoming_track = null;
             
-            UpdatePopup ();
+            OnArtworkChanged ();
         }
         
-        private string GetFirstLineText (TrackInfo track)
+        protected virtual void OnArtworkChanged ()
+        {
+        }
+        
+        protected virtual string GetFirstLineText (TrackInfo track)
         {
             return String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (track.DisplayTrackTitle));
         }
         
-        private string GetSecondLineText (TrackInfo track)
+        protected virtual string GetSecondLineText (TrackInfo track)
         {
             string markup_begin = String.Format ("<span color=\"{0}\" size=\"small\">", 
                 CairoExtensions.ColorGetHex (text_light_color, false));
@@ -551,50 +391,5 @@
                 CairoExtensions.ColorGetHex (text_color, false),
                 markup);
         }
-        
-        private bool UpdatePopup ()
-        {
-            if (current_track == null || artwork_manager == null) {
-                HidePopup ();
-                return false;
-            }
-            
-            Gdk.Pixbuf pixbuf = artwork_manager.Lookup (current_track.ArtworkId);
-         
-            if (pixbuf == null) {
-                HidePopup ();
-                return false;
-            }
-            
-            if (popup == null) {
-                popup = new ArtworkPopup ();
-                popup.EnterNotifyEvent += OnPopupEnterNotifyEvent;
-                popup.LeaveNotifyEvent += OnPopupLeaveNotifyEvent;
-            }
-            
-            popup.Label = String.Format ("{0} - {1}", current_track.DisplayArtistName, 
-                current_track.DisplayAlbumTitle);
-            popup.Image = pixbuf;
-                
-            if (in_thumbnail_region) {
-                popup.Show ();
-            }
-            
-            return true;
-        }
-        
-        private void HidePopup ()
-        {
-            if (popup != null) {
-                ArtworkRenderer.DisposePixbuf (popup.Image);
-                popup.Destroy ();
-                popup.EnterNotifyEvent -= OnPopupEnterNotifyEvent;
-                popup.LeaveNotifyEvent -= OnPopupLeaveNotifyEvent;
-                popup = null;
-            }
-        }
-        
-#endregion
-        
     }
 }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	Tue Jun 24 18:04:22 2008
@@ -117,6 +117,7 @@
     <File name="Banshee.Gui/IClientWindow.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection.Gui/ColumnCellQueryText.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Collection.Gui/QueryFilterView.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Hyena.Gui" />

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am	Tue Jun 24 18:04:22 2008
@@ -48,6 +48,7 @@
 	Banshee.Gui.DragDrop/DragDropTarget.cs \
 	Banshee.Gui.DragDrop/DragDropUtilities.cs \
 	Banshee.Gui.Widgets/ArtworkPopup.cs \
+	Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs \
 	Banshee.Gui.Widgets/ConnectedMessageBar.cs \
 	Banshee.Gui.Widgets/ConnectedSeekSlider.cs \
 	Banshee.Gui.Widgets/ConnectedVolumeButton.cs \

Modified: trunk/banshee/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs	Tue Jun 24 18:04:22 2008
@@ -121,7 +121,7 @@
             source_combo_box.Show();
             
             // Track info
-            track_info_display = new TrackInfoDisplay ();
+            track_info_display = new ClassicTrackInfoDisplay ();
             track_info_display.Show ();
             CoverBox.PackStart(track_info_display, true, true, 0);
 

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs	Tue Jun 24 18:04:22 2008
@@ -52,7 +52,7 @@
             VBox box = new VBox ();
             box.Spacing = 4;
 
-            header = new TrackInfoDisplay ();
+            header = new ClassicTrackInfoDisplay ();
             header.SetSizeRequest (320, 64);
             
             seek_slider = new ConnectedSeekSlider (SeekSliderLayout.Horizontal);



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