[nautilus] canvas-container: add a comment to explain STANDARD_ICON_GRID_WIDTH



commit 70bb20ff25a1693c19fd53cab5f545be7a98834f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 21 17:51:19 2015 -0800

    canvas-container: add a comment to explain STANDARD_ICON_GRID_WIDTH
    
    This constant is very important and needs explaining.

 libnautilus-private/nautilus-canvas-container.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 20bd5bd..7f347c9 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -93,6 +93,12 @@
 #define CONTAINER_PAD_TOP 4
 #define CONTAINER_PAD_BOTTOM 4
 
+/* Width of a "grid unit". Canvas items will always take up one or more
+ * grid units, rounding up their size relative to the unit width.
+ * So with an 80px grid unit, a 100px canvas item would take two grid units,
+ * where a 76px canvas item would only take one.
+ * Canvas items are then centered in the extra available space.
+ */
 #define STANDARD_ICON_GRID_WIDTH 80
 
 /* Desktop layout mode defines */
@@ -1275,6 +1281,7 @@ lay_down_icons_horizontal (NautilusCanvasContainer *container,
                                                            &bounds.x0, &bounds.y0,
                                                            &bounds.x1, &bounds.y1);
 
+               /* Normalize the icon width to the grid unit */
                icon_width = ceil ((bounds.x1 - bounds.x0)/grid_width) * grid_width;
 
                /* Calculate size above/below baseline */


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