st: Remove support for fixed positioning in BoxLayout

It is the job of layout containers to arrange their children; having
a hidden feature that *also* allows children to be positioned freely
outside the parent's allocation is just odd.
With the last user of the feature gone, kill it.

https://bugzilla.gnome.org/show_bug.cgi?id=703808
This commit is contained in:
Florian Müllner 2013-07-03 15:51:26 +02:00
parent 70da558802
commit 53d268a7ef
2 changed files with 8 additions and 38 deletions

View File

@ -285,7 +285,6 @@ get_content_preferred_width (StBoxLayout *self,
{ {
StBoxLayoutPrivate *priv = self->priv; StBoxLayoutPrivate *priv = self->priv;
gint n_children = 0; gint n_children = 0;
gint n_fixed = 0;
gfloat min_width, natural_width; gfloat min_width, natural_width;
ClutterActor *child; ClutterActor *child;
@ -304,12 +303,6 @@ get_content_preferred_width (StBoxLayout *self,
n_children++; n_children++;
if (clutter_actor_get_fixed_position_set (child))
{
n_fixed++;
continue;
}
if (priv->is_vertical) if (priv->is_vertical)
{ {
_st_actor_get_preferred_width (child, -1, FALSE, _st_actor_get_preferred_width (child, -1, FALSE,
@ -329,10 +322,10 @@ get_content_preferred_width (StBoxLayout *self,
} }
} }
if (!priv->is_vertical && (n_children - n_fixed) > 1) if (!priv->is_vertical && n_children > 1)
{ {
min_width += priv->spacing * (n_children - n_fixed - 1); min_width += priv->spacing * (n_children - 1);
natural_width += priv->spacing * (n_children - n_fixed - 1); natural_width += priv->spacing * (n_children - 1);
} }
if (min_width_p) if (min_width_p)
@ -367,7 +360,6 @@ get_content_preferred_height (StBoxLayout *self,
{ {
StBoxLayoutPrivate *priv = self->priv; StBoxLayoutPrivate *priv = self->priv;
gint n_children = 0; gint n_children = 0;
gint n_fixed = 0;
gfloat min_height, natural_height; gfloat min_height, natural_height;
ClutterActor *child; ClutterActor *child;
@ -386,12 +378,6 @@ get_content_preferred_height (StBoxLayout *self,
n_children++; n_children++;
if (clutter_actor_get_fixed_position_set (child))
{
n_fixed++;
continue;
}
if (priv->is_vertical) if (priv->is_vertical)
{ {
clutter_container_child_get ((ClutterContainer*) self, child, clutter_container_child_get ((ClutterContainer*) self, child,
@ -416,10 +402,10 @@ get_content_preferred_height (StBoxLayout *self,
} }
} }
if (priv->is_vertical && (n_children - n_fixed) > 1) if (priv->is_vertical && n_children > 1)
{ {
min_height += priv->spacing * (n_children - n_fixed - 1); min_height += priv->spacing * (n_children - 1);
natural_height += priv->spacing * (n_children - n_fixed - 1); natural_height += priv->spacing * (n_children - 1);
} }
if (min_height_p) if (min_height_p)
@ -511,12 +497,9 @@ compute_shrinks (StBoxLayout *self,
{ {
gfloat child_min, child_nat; gfloat child_min, child_nat;
gboolean child_fill; gboolean child_fill;
gboolean fixed;
fixed = clutter_actor_get_fixed_position_set (child);
shrinks[i].child_index = i; shrinks[i].child_index = i;
if (CLUTTER_ACTOR_IS_VISIBLE (child) && !fixed) if (CLUTTER_ACTOR_IS_VISIBLE (child))
{ {
if (priv->is_vertical) if (priv->is_vertical)
{ {
@ -738,20 +721,13 @@ st_box_layout_allocate (ClutterActor *actor,
{ {
ClutterActorBox child_box; ClutterActorBox child_box;
gfloat child_min, child_nat, child_allocated; gfloat child_min, child_nat, child_allocated;
gboolean xfill, yfill, expand, fixed; gboolean xfill, yfill, expand;
StAlign xalign, yalign; StAlign xalign, yalign;
gdouble xalign_f, yalign_f; gdouble xalign_f, yalign_f;
if (!CLUTTER_ACTOR_IS_VISIBLE (child)) if (!CLUTTER_ACTOR_IS_VISIBLE (child))
goto next_child; goto next_child;
fixed = clutter_actor_get_fixed_position_set (child);
if (fixed)
{
clutter_actor_allocate_preferred_size (child, flags);
goto next_child;
}
clutter_container_child_get ((ClutterContainer*) actor, child, clutter_container_child_get ((ClutterContainer*) actor, child,
"x-fill", &xfill, "x-fill", &xfill,
"y-fill", &yfill, "y-fill", &yfill,

View File

@ -45,12 +45,6 @@ function test() {
style: 'border: 1px solid #aaaaaa; ' style: 'border: 1px solid #aaaaaa; '
+ 'background: #cceeff' })); + 'background: #cceeff' }));
b2.add(new St.Label({ x: 50,
y: 50,
text: "Fixed",
style: 'border: 1px solid #aaaaaa;'
+ 'background: #ffffcc' }));
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
function createCollapsableBox(width) { function createCollapsableBox(width) {