summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2009-10-23 16:03:33 -0400
committerThomas Thurman <tthurman@gnome.org>2009-10-23 16:03:33 -0400
commit0272e221d510bc17fcf867cead4bf3ea07034988 (patch)
tree2e600a5a6093df4e1334a3c741a7904d5ea7cd19
parente1eec1b36df4d5cbcb992b45f4bdd5c6d10d11cf (diff)
downloadmetacity-0272e221d510bc17fcf867cead4bf3ea07034988.tar.gz
do not attempt to do size calculation while painting rectangles; do not handle margins (for the moment)
-rw-r--r--src/ui/theme.c74
1 files changed, 1 insertions, 73 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 4353778c..177c8dc9 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -313,26 +313,9 @@ meta_theme_get_title_scale (MetaTheme *theme,
return 1.0;
}
-static gboolean
-get_number_from_style (ccss_style_t *style,
- char *element,
- int *dummy,
- int *original_value)
-{
- double d = 0.0;
- gboolean result;
-
- result = ccss_style_get_double (style, element, &d);
-
- if (original_value)
- *original_value = d;
-
- return result;
-}
-
/*
* FIXME: This is only called in one place;
- * shd possibly be inlined
+ * shd be inlined
*/
static void
draw_rectangle (ccss_stylesheet_t *stylesheet,
@@ -344,63 +327,8 @@ draw_rectangle (ccss_stylesheet_t *stylesheet,
{
ccss_style_t *style = ccss_stylesheet_query (stylesheet,
(ccss_node_t*) &cowbell_nodes[style_id]);
- int horizontal_margin = 0;
-
if (!style || w==0 || h==0) return;
- if (honour_margins)
- {
- int mn, mt, mr, mb, ml;
-
- /*
- * FIXME: Is all this still really necessary?
- */
-
- /* FIXME: Setting just "margin" doesn't work
- * because libccss doesn't know about margins.
- */
- get_number_from_style (style, "margin", NULL, &mn);
- if (mn)
- {
- /* FIXME this is broken; "margin" may have multiple values */
- mt = mr = mb = ml = mn;
- }
- else
- {
- get_number_from_style (style, "margin-top", NULL, &mt);
- get_number_from_style (style, "margin-right", NULL, &mr);
- get_number_from_style (style, "margin-bottom", NULL, &mb);
- get_number_from_style (style, "margin-left", NULL, &ml);
- }
-
- x += ml;
- y += mt;
- horizontal_margin = ml+mr;
- h -= (mt+mb);
- }
-
- if (w==0)
- {
- int height, width;
-
- get_number_from_style (style, "height", NULL, &height);
- get_number_from_style (style, "width", NULL, &width);
-
- if (height!=0 && width!=0)
- {
- int min_w, max_w;
- double scale = ((double)h/(double)height);
-
- w = (int) ((double)width) * scale;
-
- get_number_from_style (style, "min-width", NULL, &min_w);
- get_number_from_style (style, "max-width", NULL, &max_w);
-
- if (max_w && w>max_w && max_w>min_w) w = max_w;
- if (w<min_w) w = min_w;
- }
- }
-
ccss_cairo_style_draw_rectangle (style, cr, x, y, w, h);
ccss_style_destroy (style);