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
This commit is contained in:
Rui Matos 2015-03-27 17:34:26 +01:00
parent a4b5583995
commit 216e996f66
2 changed files with 8 additions and 30 deletions

View File

@ -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;

View File

@ -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;
}
if (right)
{
node->margin[ST_SIDE_RIGHT] = value;
node->margin_set |= 1 << ST_SIDE_RIGHT;
}
if (top)
{
node->margin[ST_SIDE_TOP] = value;
node->margin_set |= 1 << ST_SIDE_TOP;
}
if (bottom)
{
node->margin[ST_SIDE_BOTTOM] = value;
node->margin_set |= 1 << ST_SIDE_BOTTOM;
}
}
static void
@ -3188,17 +3176,9 @@ _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));
}