banshee r3500 - in trunk/banshee: . src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Collection.Gui



Author: abock
Date: Fri Mar 21 02:35:02 2008
New Revision: 3500
URL: http://svn.gnome.org/viewvc/banshee?rev=3500&view=rev

Log:
2008-03-20  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TerseTrackListView.cs:
    Started a new track view that can be very narrow and won't have columns;
    think, 'is this what a detachable play queue looks like?'

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs:
    Started a cell renderer for showing a track in a list with a single column

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/BetaReleaseViewOverlay.cs:
    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs:
    Get rid of the preview release overlay thingy. It sucked.



Added:
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TerseTrackListView.cs
Removed:
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/BetaReleaseViewOverlay.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
   trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am

Added: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs	Fri Mar 21 02:35:02 2008
@@ -0,0 +1,85 @@
+//
+// ColumnCellTrack.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 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 Gtk;
+using Cairo;
+
+using Hyena.Data.Gui;
+
+namespace Banshee.Collection.Gui
+{
+    public class ColumnCellTrack : ColumnCell
+    {
+        public ColumnCellTrack () : base (null, true)
+        {
+        }
+        
+        public int ComputeRowHeight (Widget widget)
+        {
+            int lw, lh;
+            Pango.Layout layout = new Pango.Layout (widget.PangoContext);
+            layout.SetMarkup ("<b>W</b>\n<small><i>W</i></small>");
+            layout.GetPixelSize (out lw, out lh);
+            return lh + 4;
+        }
+        
+        public override void Render (CellContext context, StateType state, double cellWidth, double cellHeight)
+        {
+            if (BoundObject == null) {
+                return;
+            }
+            
+            if (!(BoundObject is TrackInfo)) {
+                throw new InvalidCastException ("ColumnCellAlbum can only bind to AlbumInfo objects");
+            }
+            
+            TrackInfo track = (TrackInfo)BoundObject;
+            
+            Pango.Layout layout = context.Layout;
+            
+            int x = 5, y = 0;
+            int lw, lh;
+            
+            layout.Width = (int)((cellWidth - 2 * x) * Pango.Scale.PangoScale);
+            layout.Ellipsize = Pango.EllipsizeMode.End;
+            layout.FontDescription = context.Widget.PangoContext.FontDescription.Copy ();
+            layout.SetMarkup (String.Format ("<b>{0}</b>\n<small><i>{1}</i></small>", 
+                GLib.Markup.EscapeText (track.DisplayTrackTitle), 
+                GLib.Markup.EscapeText (track.DisplayArtistName)));
+            
+            layout.GetPixelSize (out lw, out lh);
+            
+            y = (int)((cellHeight - lh) / 2);
+            
+            Style.PaintLayout (context.Widget.Style, context.Drawable, state, true, 
+                context.Area, context.Widget, "text",
+                context.Area.X + x, context.Area.Y + y, layout);
+        }
+    }
+}

Added: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TerseTrackListView.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TerseTrackListView.cs	Fri Mar 21 02:35:02 2008
@@ -0,0 +1,58 @@
+//
+// TerseTrackListView.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 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 Hyena.Data;
+using Hyena.Data.Gui;
+
+using Banshee.Collection;
+using Banshee.ServiceStack;
+using Banshee.Gui;
+
+namespace Banshee.Collection.Gui
+{
+    public class TerseTrackListView : ListView<TrackInfo>
+    {
+        private ColumnController column_controller;
+        
+        public TerseTrackListView () : base ()
+        {
+            ColumnCellTrack renderer = new ColumnCellTrack ();
+        
+            column_controller = new ColumnController ();
+            column_controller.Add (new Column ("Track", renderer, 1.0));
+            
+            ColumnController = column_controller;
+            
+            RowHeight = renderer.ComputeRowHeight (this);
+            HeaderVisible = false;
+            RulesHint = true;
+        }
+    }
+}

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs	Fri Mar 21 02:35:02 2008
@@ -46,7 +46,6 @@
     public class TrackListView : ListView<TrackInfo>
     {
         private PersistentColumnController column_controller;
-        private BetaReleaseViewOverlay overlay;
 
         public TrackListView () : base ()
         {
@@ -98,22 +97,10 @@
                     QueueDraw ();
                 };
             }
-
-            if (!Banshee.Base.ApplicationContext.Debugging) {
-                overlay = new BetaReleaseViewOverlay (this);
-                overlay.Finished += OnOverlayFinished;
-            }
             
             ForceDragSourceSet = true;
             Reorderable = true;
         }
-        
-        private void OnOverlayFinished (object o, EventArgs args)
-        {
-            overlay.Finished -= OnOverlayFinished;
-            overlay = null;
-            QueueDraw ();
-        }
 
         protected override bool OnPopupMenu ()
         {
@@ -125,13 +112,6 @@
         {
             QueueDraw ();
         }
-
-        protected override void ChildClassPostRender (Gdk.EventExpose evnt, Cairo.Context cr, Gdk.Rectangle clip)
-        {
-            if (overlay != null) {
-                overlay.Render (Theme, ListAllocation, cr, clip);
-            }
-        }
         
 #region Drag and Drop
 

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	Fri Mar 21 02:35:02 2008
@@ -100,7 +100,8 @@
     <File name="Banshee.Gui.Widgets/RepeatActionButton.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui/PlaybackRepeatActions.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui/BansheeDbFormatMigratorMonitor.cs" subtype="Code" buildaction="Compile" />
-    <File name="Banshee.Collection.Gui/BetaReleaseViewOverlay.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Collection.Gui/TerseTrackListView.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Collection.Gui/ColumnCellTrack.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	Fri Mar 21 02:35:02 2008
@@ -13,13 +13,14 @@
 	Banshee.Collection.Gui/ArtistListView.cs \
 	Banshee.Collection.Gui/ArtworkManager.cs \
 	Banshee.Collection.Gui/ArtworkRenderer.cs \
-	Banshee.Collection.Gui/BetaReleaseViewOverlay.cs \
 	Banshee.Collection.Gui/ColumnCellAlbum.cs \
 	Banshee.Collection.Gui/ColumnCellDateTime.cs \
 	Banshee.Collection.Gui/ColumnCellDuration.cs \
 	Banshee.Collection.Gui/ColumnCellPlaybackIndicator.cs \
+	Banshee.Collection.Gui/ColumnCellTrack.cs \
 	Banshee.Collection.Gui/ColumnCellTrackNumber.cs \
 	Banshee.Collection.Gui/PersistentColumnController.cs \
+	Banshee.Collection.Gui/TerseTrackListView.cs \
 	Banshee.Collection.Gui/TrackListView.cs \
 	Banshee.Equalizer.Gui/EqualizerBandScale.cs \
 	Banshee.Equalizer.Gui/EqualizerLevelsBox.cs \



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