banshee r3496 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView



Author: scottp
Date: Fri Mar 21 01:07:36 2008
New Revision: 3496
URL: http://svn.gnome.org/viewvc/banshee?rev=3496&view=rev

Log:
* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs:
Fixed rendering in with non-composited window managers.

* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs:
Got rid of private method - instead use Gdk.Rectangle.Contains()

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs	Fri Mar 21 01:07:36 2008
@@ -193,29 +193,14 @@
             return base.OnKeyPressEvent (press);
         }
         
-        private static bool IsEventInAlloc (Gdk.EventButton evnt, Gdk.Rectangle alloc)
-        {
-            if (evnt.X < alloc.Left) {
-                return false;
-            } else if (evnt.X > alloc.Right) {
-                return false;
-            } else if (evnt.Y < alloc.Top) {
-                return false;
-            } else if (evnt.Y > alloc.Bottom) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        
 #region OnButtonPress
 
         protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
         {
             HasFocus = true;
-            if (IsEventInAlloc (evnt, header_interaction_alloc)) {
+            if (header_interaction_alloc.Contains ((int)evnt.X, (int)evnt.Y)) {
                 return OnHeaderButtonPressEvent (evnt);
-            } else if (IsEventInAlloc (evnt, list_interaction_alloc) && model != null) {
+            } else if (list_interaction_alloc.Contains ((int)evnt.X, (int)evnt.Y) && model != null) {
                 return OnListButtonPressEvent (evnt);
             }
             return true;
@@ -341,9 +326,9 @@
                 return true;
             }
             
-            if (IsEventInAlloc (evnt, header_interaction_alloc)) {
+            if (header_interaction_alloc.Contains ((int)evnt.X, (int)evnt.Y)) {
                 return OnHeaderButtonRelease (evnt);
-            } else if (IsEventInAlloc (evnt, list_interaction_alloc) && model != null &&
+            } else if (list_interaction_alloc.Contains ((int)evnt.X, (int)evnt.Y) && model != null &&
                 (evnt.State & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask)) == 0) {
                 return OnListButtonRelease (evnt);
             }

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs	Fri Mar 21 01:07:36 2008
@@ -58,10 +58,12 @@
         protected override bool OnExposeEvent (Gdk.EventExpose evnt)
         {         
             cairo_context = Gdk.CairoHelper.Create (evnt.Window);
-               
+            
+            Gdk.Rectangle damage = new Gdk.Rectangle ();
             foreach (Gdk.Rectangle rect in evnt.Region.GetRectangles ()) {
-                PaintRegion (evnt, rect);
+                damage = damage.Union (rect);
             }
+            PaintRegion (evnt, damage);
             
             ((IDisposable)cairo_context.Target).Dispose ();
             ((IDisposable)cairo_context).Dispose ();
@@ -83,8 +85,10 @@
         
         private void PaintHeader (Gdk.Rectangle clip)
         {
-            clip.Intersect (header_rendering_alloc);
-            cairo_context.Rectangle (clip.X, clip.Y, clip.Width, clip.Height + Theme.BorderWidth);
+            Gdk.Rectangle rect = header_rendering_alloc;
+            rect.Height += Theme.BorderWidth;
+            clip.Intersect (rect);
+            cairo_context.Rectangle (clip.X, clip.Y, clip.Width, clip.Height);
             cairo_context.Clip ();
             
             header_pango_layout = PangoCairoHelper.CreateLayout (cairo_context);



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