summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2009-10-28 15:20:19 -0400
committerThomas Thurman <tthurman@gnome.org>2009-10-28 15:20:19 -0400
commita2075f9d952ee0393cc98232d543c3927e9e4f68 (patch)
treebe0e3aeb79e9321a12c27bf8a9492069002c2f9c
parent537afca6fcc6ccdb1bdb54d81b9aaf4295677e88 (diff)
downloadmetacity-a2075f9d952ee0393cc98232d543c3927e9e4f68.tar.gz
honour border-radius on frame
-rw-r--r--src/ui/theme.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 4c280a0f..6adac4dc 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1237,14 +1237,40 @@ meta_theme_calc_geometry (MetaTheme *theme,
}
#endif
- /****************************************************************/
- /* Old code which needs replacing: */
-
- /* Rounded corners; need to pick these up from the CSS. FIXME. */
- fgeom->top_left_corner_rounded_radius = 5;
- fgeom->top_right_corner_rounded_radius = 5;
- fgeom->bottom_left_corner_rounded_radius = 5;
- fgeom->bottom_right_corner_rounded_radius = 5;
+ /* Finally, pick up the rounded corners. */
+ {
+ double d;
+ int default_radius;
+ ccss_style_t *style = ccss_stylesheet_query (theme->stylesheet,
+ (ccss_node_t*) &cowbell_nodes[CC_FRAME]);
+
+ if (ccss_style_get_double (style, "border-radius", &d))
+ default_radius = (int) d;
+ else
+ default_radius = 0;
+
+ if (ccss_style_get_double (style, "border-top-left-radius", &d))
+ fgeom->top_left_corner_rounded_radius = (int) d;
+ else
+ fgeom->top_left_corner_rounded_radius = default_radius;
+
+ if (ccss_style_get_double (style, "border-top-right-radius", &d))
+ fgeom->top_right_corner_rounded_radius = (int) d;
+ else
+ fgeom->top_right_corner_rounded_radius = default_radius;
+
+ if (ccss_style_get_double (style, "border-bottom-left-radius", &d))
+ fgeom->bottom_left_corner_rounded_radius = (int) d;
+ else
+ fgeom->bottom_left_corner_rounded_radius = default_radius;
+
+ if (ccss_style_get_double (style, "border-bottom-right-radius", &d))
+ fgeom->bottom_right_corner_rounded_radius = (int) d;
+ else
+ fgeom->bottom_right_corner_rounded_radius = default_radius;
+
+ ccss_style_destroy (style);
+ }
}
/*