[banshee/1.5.1-fixes: 31/56] [ListView] Fix column size calculation



commit 90148b332abee3b58eb24feeeed4c5d3c91fbb50
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Thu Nov 12 12:08:29 2009 +1100

    [ListView] Fix column size calculation
    
    RecalculateColumnSizes() stops adapting the column sizes when
    first value of remaining_width is negative. This always happens if
    there are several fixed-width columns (e.g. year, bitrate and rating)
    at the end of the list view. The result is that these columns are
    allocated less space than they require.
    
    The fix changes the method so that it continues refitting the columns
    until remaining_width is close to zero.

 .../Hyena.Data.Gui/ListView/ListView_Header.cs     |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
index 707a6e7..eb356c5 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
@@ -191,7 +191,7 @@ namespace Hyena.Data.Gui
                 
                 double remaining_width = RecalculateColumnSizes (header_width, header_width);
                 
-                while (remaining_width > 0 && elastic_columns.Count > 0) {
+                while (Math.Round (remaining_width) != 0.0 && elastic_columns.Count > 0) {
                     double total_elastic_width = 0.0;
                     foreach (int i in elastic_columns) {
                         total_elastic_width += column_cache[i].ElasticWidth;



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