[banshee/stable-2.6] Fixup: fixed selecting option values (bgo#732993)



commit 05949fd6b94a0249043054d4860d7d42cac2afd3
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Thu Jul 10 14:54:32 2014 +0200

    Fixup: fixed selecting option values (bgo#732993)
    
    Instead of adding to a list new length of text, sum of previous and
    current text was added. That causes widening range of next option values.
    Because of that, it was impossible to select e.g. fifth (or further)
    value.
    
    Signed-off-by: Andrés G. Aragoneses <knocte gmail com>

 .../Banshee.Fixup/ColumnCellSolutionOptions.cs     |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/Extensions/Banshee.Fixup/Banshee.Fixup/ColumnCellSolutionOptions.cs 
b/src/Extensions/Banshee.Fixup/Banshee.Fixup/ColumnCellSolutionOptions.cs
index 1e683f4..c191c10 100644
--- a/src/Extensions/Banshee.Fixup/Banshee.Fixup/ColumnCellSolutionOptions.cs
+++ b/src/Extensions/Banshee.Fixup/Banshee.Fixup/ColumnCellSolutionOptions.cs
@@ -56,13 +56,12 @@ namespace Banshee.Fixup
             if (measure) {
                 solution_value_widths.Clear ();
                 var sb = new StringBuilder ();
-                int x = 0, w, h;
+                int w, h;
                 foreach (var str in SolutionOptions) {
                     sb.Append (str);
                     context.Layout.SetMarkup (sb.ToString ());
                     context.Layout.GetPixelSize (out w, out h);
-                    x += w;
-                    solution_value_widths.Add (x);
+                    solution_value_widths.Add (w);
                     sb.Append (solution_joiner);
                 }
             }
@@ -92,7 +91,7 @@ namespace Banshee.Fixup
 
             int cur_x = 0;
             for (int i = 0; i < solution_value_widths.Count; i++) {
-                cur_x += solution_value_widths[i];
+                cur_x = solution_value_widths[i];
                 if (x < cur_x)
                     return i;
             }


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