banshee r3168 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Hyena.Gui/Hyena.Data.Gui



Author: abock
Date: Thu Feb  7 22:02:16 2008
New Revision: 3168
URL: http://svn.gnome.org/viewvc/banshee?rev=3168&view=rev

Log:
2008-02-07  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs:
    Implement OnDragSourceSet; the ListView will call this when it's okay
    for drag sources to be enabled

    * src/Core/Hyena.Gui/Hyena.Data.Gui/ListView.cs: Added a virtual
    OnDragSourceSet method that the view will call when drag and drop from
    the widget is allowed (i.e. when not playing with the header); remove
    drag sources when the header is pressed, add them back when released



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs
   trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListView.cs

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	Thu Feb  7 22:02:16 2008
@@ -83,8 +83,6 @@
                     QueueDraw ();
                 };
             }
-            
-            ConfigureDragAndDrop ();
         }
 
         protected override bool OnPopupMenu ()
@@ -104,11 +102,11 @@
             DragDropTarget.ModelSelection
         };
 
-        private void ConfigureDragAndDrop ()
+        protected override void OnDragSourceSet ()
         {
             Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask, 
                 dnd_source_entries, Gdk.DragAction.Copy | Gdk.DragAction.Move);
-                
+            
             Drag.SourceSetIconName (this, "audio-x-generic");
         }
 

Modified: trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListView.cs
==============================================================================
--- trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListView.cs	(original)
+++ trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListView.cs	Thu Feb  7 22:02:16 2008
@@ -337,6 +337,8 @@
             // graphics context for drawing theme parts
             graphics = new ListViewGraphics(this);
             graphics.RefreshColors();
+            
+            OnDragSourceSet ();
         }
         
         protected override void OnUnrealized()
@@ -612,6 +614,7 @@
             HasFocus = true;
             
             if (press.Window == header_window) {
+                Gtk.Drag.SourceUnset (this);
                 Column column = GetColumnForResizeHandle ((int) press.X);
                 if (column != null) {
                     resizing_column_index = GetCachedColumnForColumn (column).Index;
@@ -676,6 +679,8 @@
         {
            // Console.WriteLine 
             if(evnt.Window == header_window) {
+                OnDragSourceSet ();
+                
                 if(resizing_column_index >= 0) {
                     resizing_column_index = -1;
                     header_window.Cursor = null;
@@ -1228,5 +1233,13 @@
         
 #endregion  
 
+#region Drag and Drop
+        
+        protected virtual void OnDragSourceSet ()
+        {
+        }
+        
+#endregion
+
     }
 }
\ No newline at end of file



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