[metacity/cowbell] attempt to make it honour margins correctly



commit 6e1639133aa2cc05d050dd8be467b154530b1f03
Author: Thomas Thurman <tthurman gnome org>
Date:   Sun Oct 25 01:48:07 2009 -0400

    attempt to make it honour margins correctly

 src/ui/theme.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 78fc351..72e3905 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -420,16 +420,25 @@ meta_theme_draw_frame_with_style (MetaTheme              *theme,
     {
       ccss_style_t *style = ccss_stylesheet_query (stylesheet,
                                                    (ccss_node_t*) &cowbell_nodes[i]);
-      if (!style ||
-          fgeom.areas[i].width == 0 ||
-          fgeom.areas[i].height == 0)
+      int x = fgeom.areas[i].x;
+      int y = fgeom.areas[i].y;
+      int width = fgeom.areas[i].width;
+      int height = fgeom.areas[i].height;
+
+      if (!style)
         continue;
 
-      ccss_cairo_style_draw_rectangle (style, cr,
-                                       fgeom.areas[i].x,
-                                       fgeom.areas[i].y,
-                                       fgeom.areas[i].width,
-                                       fgeom.areas[i].height);
+      meta_warning ("%d", fgeom.areas[i].left_margin);
+
+      x += fgeom.areas[i].left_margin;
+      width -= (fgeom.areas[i].left_margin + fgeom.areas[i].right_margin);
+      y += fgeom.areas[i].top_margin;
+      height -= (fgeom.areas[i].top_margin + fgeom.areas[i].bottom_margin);
+
+      if (width > 0 && height > 0)
+        ccss_cairo_style_draw_rectangle (style, cr,
+                                         x, y,
+                                         width, height);
 
       ccss_style_destroy (style);
     }



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