[hyena] Fix ListView grid interactions



commit 7cf942561b42e3382dbe7f0f671855bc8ecbe655
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Wed Mar 10 17:40:08 2010 -0800

    Fix ListView grid interactions

 .../ListView/ListView_Interaction.cs               |    2 +-
 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
index 917f2aa..afaf78b 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
@@ -163,7 +163,7 @@ namespace Hyena.Data.Gui
             bool handled = false;
             // FIXME: hard-coded grid logic here...
             bool grid = ViewLayout != null;
-            int items_per_row = grid ? 1 : 1;
+            int items_per_row = grid ? (ViewLayout as DataViewLayoutGrid).Columns : 1;
 
             switch (press.Key) {
                 case Gdk.Key.a:
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index 1e4cbe3..2883132 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -549,7 +549,11 @@ namespace Hyena.Data.Gui
 
         private Gdk.Size child_size = Gdk.Size.Empty;
         public Gdk.Size ChildSize {
-            get { return child_size; }
+            get {
+                return ViewLayout != null
+                    ? new Gdk.Size ((int)ViewLayout.ChildSize.Width, (int)ViewLayout.ChildSize.Height)
+                    : child_size;
+            }
         }
 
         private bool measure_pending;



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