No padding
authorEnrico Zini <enrico@enricozini.org>
Thu, 10 Dec 2009 10:34:14 +0000 (10:34 +0000)
committerEnrico Zini <enrico@enricozini.org>
Thu, 10 Dec 2009 10:34:14 +0000 (10:34 +0000)
src/fisheye.vala

index 59cf1824e4ee699df5fe83c1b12eac176630e203..b8342393263718defac1526b0de5cbbf119af49c 100644 (file)
@@ -218,6 +218,7 @@ public class FisheyeList : Gtk.DrawingArea
        {
                var res = new Gtk.CellRendererText();
                res.font_desc = get_style().font_desc;
+               res.ypad = 0;
                return res;
        }
 
@@ -322,8 +323,8 @@ public class FisheyeList : Gtk.DrawingArea
                Gdk.Rectangle cell_area = Gdk.Rectangle();
                cell_area.x = 0;
                cell_area.width = allocation.width;
-               cell_area.height = 1;
-               if (label_cache.length >= allocation.height)
+               renderers[0].get_size(this, null, null, null, null, out cell_area.height);
+               if (label_cache.length * cell_area.height >= allocation.height)
                {
                        for (int y = 0; y < allocation.height; ++y)
                        {
@@ -337,19 +338,19 @@ public class FisheyeList : Gtk.DrawingArea
                                                0);
                        }
                } else {
-                       int count = int.min(allocation.height/2, label_cache.length); 
-                       for (int y = 0; y < count; ++y)
+                       int count = int.min(allocation.height/(2*cell_area.height), label_cache.length);
+                       for (int idx = 0; idx < count; ++idx)
                        {
-                               cell_area.y = y;
-                               renderers[0].text = label_cache[y];
+                               cell_area.y = idx * cell_area.height;
+                               renderers[0].text = label_cache[idx];
                                renderers[0].render((Gdk.Window*)drawable, this, 
                                                cell_area,
                                                cell_area,
                                                expose_area,
                                                0);
 
-                               cell_area.y = allocation.height-y;
-                               renderers[0].text = label_cache[label_cache.length-y];
+                               cell_area.y = allocation.height-cell_area.y;
+                               renderers[0].text = label_cache[label_cache.length-idx];
                                renderers[0].render((Gdk.Window*)drawable, this, 
                                                cell_area,
                                                cell_area,