From 216e996f6680a3ffb797caafe1ed29990360c8f1 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Fri, 27 Mar 2015 17:34:26 +0100 Subject: [PATCH] st-theme-node: Unconditionally apply style margins on the actor We currently don't have any code either in gnome-shell or gnome-shell-extensions setting margins directly with the Clutter API. On the other hand, the current behavior doesn't allow us to remove a style class with margins and have that be reflected, so removing this special casing seems like the right thing to do at this point. https://bugzilla.gnome.org/show_bug.cgi?id=746902 --- src/st/st-theme-node-private.h | 2 -- src/st/st-theme-node.c | 36 ++++++++-------------------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h index 7a2a383c0..f691cae6b 100644 --- a/src/st/st-theme-node-private.h +++ b/src/st/st-theme-node-private.h @@ -92,8 +92,6 @@ struct _StThemeNode { guint background_position_set : 1; guint background_repeat : 1; - gboolean margin_set : 4; - guint properties_computed : 1; guint geometry_computed : 1; guint background_computed : 1; diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index 7acb5708c..4c8fabd40 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -1672,25 +1672,13 @@ do_margin_property_term (StThemeNode *node, return; if (left) - { - node->margin[ST_SIDE_LEFT] = value; - node->margin_set |= 1 << ST_SIDE_LEFT; - } + node->margin[ST_SIDE_LEFT] = value; if (right) - { - node->margin[ST_SIDE_RIGHT] = value; - node->margin_set |= 1 << ST_SIDE_RIGHT; - } + node->margin[ST_SIDE_RIGHT] = value; if (top) - { - node->margin[ST_SIDE_TOP] = value; - node->margin_set |= 1 << ST_SIDE_TOP; - } + node->margin[ST_SIDE_TOP] = value; if (bottom) - { - node->margin[ST_SIDE_BOTTOM] = value; - node->margin_set |= 1 << ST_SIDE_BOTTOM; - } + node->margin[ST_SIDE_BOTTOM] = value; } static void @@ -3188,18 +3176,10 @@ _st_theme_node_apply_margins (StThemeNode *node, _st_theme_node_ensure_geometry (node); - // In the case that a CSS margin is not specified, we don't to set a value - // of 0 to the clutter actor margin. In this manner it allows to use Clutter - // margin values set in the code. However, the margins that are set both in - // the code and in the CSS on the same side, the result is unpredictable. - if (node->margin_set & 1 << ST_SIDE_LEFT) - clutter_actor_set_margin_left (actor, st_theme_node_get_margin(node, ST_SIDE_LEFT)); - if (node->margin_set & 1 << ST_SIDE_RIGHT) - clutter_actor_set_margin_right (actor, st_theme_node_get_margin(node, ST_SIDE_RIGHT)); - if (node->margin_set & 1 << ST_SIDE_TOP) - clutter_actor_set_margin_top (actor, st_theme_node_get_margin(node, ST_SIDE_TOP)); - if (node->margin_set & 1 << ST_SIDE_BOTTOM) - clutter_actor_set_margin_bottom (actor, st_theme_node_get_margin(node, ST_SIDE_BOTTOM)); + clutter_actor_set_margin_left (actor, st_theme_node_get_margin(node, ST_SIDE_LEFT)); + clutter_actor_set_margin_right (actor, st_theme_node_get_margin(node, ST_SIDE_RIGHT)); + clutter_actor_set_margin_top (actor, st_theme_node_get_margin(node, ST_SIDE_TOP)); + clutter_actor_set_margin_bottom (actor, st_theme_node_get_margin(node, ST_SIDE_BOTTOM)); } static GetFromTermResult