[hyena] [Hyena.Gui] Have Grid columns expand to fill width



commit 4b6e355c43844688fcae57225bb661bc5b6c56fe
Author: Kevin Duffus <KevinDuffus gmail com>
Date:   Wed Oct 27 13:03:16 2010 -0700

    [Hyena.Gui] Have Grid columns expand to fill width
    
    This way extra white space to the right of the grid is instead evenly
    distributed among the columns (bgo#633290).
    
    Signed-off-by: Gabriel Burt <gabriel burt gmail com>

 Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs b/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
index a563d48..2f89399 100644
--- a/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
@@ -91,6 +91,7 @@ namespace Hyena.Data.Gui
             int last_model_row = first_model_row + Rows * Columns;
 
             // Setup for the layout iteration
+            int child_span_width = (int)Math.Floor (ActualAllocation.Width / Columns);
             int model_row_index = first_model_row;
             int layout_child_index = 0;
             int view_row_index = 0;
@@ -126,7 +127,7 @@ namespace Hyena.Data.Gui
                     child_allocation.Y += ChildSize.Height;
                     child_allocation.X = ActualAllocation.X;
                 } else {
-                    child_allocation.X += ChildSize.Width;
+                    child_allocation.X += child_span_width;
                 }
 
                 // FIXME: clear any layout children that go beyond the model



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