mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
[layout] Remove FlowLayout:wrap
The :wrap property is not implemented, and mostly useless: the FlowLayout is a reflowing grid. This means that if it receives less than the preferred width or height in the flow direction then it should always reflow.
This commit is contained in:
parent
6d954ec074
commit
19317520b5
@ -71,7 +71,6 @@ struct _ClutterFlowLayoutPrivate
|
|||||||
|
|
||||||
gint max_row_items;
|
gint max_row_items;
|
||||||
|
|
||||||
guint layout_wrap : 1;
|
|
||||||
guint is_homogeneous : 1;
|
guint is_homogeneous : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -89,9 +88,7 @@ enum
|
|||||||
PROP_MIN_COLUMN_WIDTH,
|
PROP_MIN_COLUMN_WIDTH,
|
||||||
PROP_MAX_COLUMN_WIDTH,
|
PROP_MAX_COLUMN_WIDTH,
|
||||||
PROP_MIN_ROW_HEGHT,
|
PROP_MIN_ROW_HEGHT,
|
||||||
PROP_MAX_ROW_HEIGHT,
|
PROP_MAX_ROW_HEIGHT
|
||||||
|
|
||||||
PROP_WRAP
|
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (ClutterFlowLayout,
|
G_DEFINE_TYPE (ClutterFlowLayout,
|
||||||
@ -352,10 +349,6 @@ clutter_flow_layout_set_property (GObject *gobject,
|
|||||||
clutter_flow_layout_set_orientation (self, g_value_get_enum (value));
|
clutter_flow_layout_set_orientation (self, g_value_get_enum (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_WRAP:
|
|
||||||
clutter_flow_layout_set_wrap (self, g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_HOMOGENEOUS:
|
case PROP_HOMOGENEOUS:
|
||||||
clutter_flow_layout_set_homogeneous (self, g_value_get_boolean (value));
|
clutter_flow_layout_set_homogeneous (self, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
@ -412,10 +405,6 @@ clutter_flow_layout_get_property (GObject *gobject,
|
|||||||
g_value_set_enum (value, priv->orientation);
|
g_value_set_enum (value, priv->orientation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_WRAP:
|
|
||||||
g_value_set_boolean (value, priv->layout_wrap);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_HOMOGENEOUS:
|
case PROP_HOMOGENEOUS:
|
||||||
g_value_set_boolean (value, priv->is_homogeneous);
|
g_value_set_boolean (value, priv->is_homogeneous);
|
||||||
break;
|
break;
|
||||||
@ -477,9 +466,8 @@ clutter_flow_layout_class_init (ClutterFlowLayoutClass *klass)
|
|||||||
*
|
*
|
||||||
* The orientation of the #ClutterFlowLayout. The children
|
* The orientation of the #ClutterFlowLayout. The children
|
||||||
* of the layout will be layed out following the orientation.
|
* of the layout will be layed out following the orientation.
|
||||||
* If #ClutterFlowLayout:wrap is set to %TRUE then this property
|
*
|
||||||
* will control the primary direction of the layout before
|
* This property also controls the overflowing directions
|
||||||
* wrapping takes place
|
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
@ -508,36 +496,12 @@ clutter_flow_layout_class_init (ClutterFlowLayoutClass *klass)
|
|||||||
CLUTTER_PARAM_READWRITE);
|
CLUTTER_PARAM_READWRITE);
|
||||||
g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS, pspec);
|
g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS, pspec);
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterFlowLayout:wrap:
|
|
||||||
*
|
|
||||||
* Whether the layout should wrap the children to fit them
|
|
||||||
* in the allocation. A non-wrapping layout has a preferred
|
|
||||||
* size of the biggest child in the direction opposite to the
|
|
||||||
* #ClutterFlowLayout:orientation property, and the sum of
|
|
||||||
* the preferred sizes (taking into account spacing) of the
|
|
||||||
* children in the direction of the orientation
|
|
||||||
*
|
|
||||||
* If a wrapping #ClutterFlowLayout is allocated less than the
|
|
||||||
* preferred size in the direction of orientation then it will
|
|
||||||
* not allocate and paint the children falling out of the
|
|
||||||
* allocation box
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*/
|
|
||||||
pspec = g_param_spec_boolean ("wrap",
|
|
||||||
"Wrap",
|
|
||||||
"Whether the layout should wrap",
|
|
||||||
FALSE,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
g_object_class_install_property (gobject_class, PROP_WRAP, pspec);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterFlowLayout:column-spacing:
|
* ClutterFlowLayout:column-spacing:
|
||||||
*
|
*
|
||||||
* The spacing between columns, in pixels; the value of this
|
* The spacing between columns, in pixels; the value of this
|
||||||
* property is honoured by horizontal non-wrapping layouts and
|
* property is honoured by horizontal non-overflowing layouts
|
||||||
* by vertical wrapping layouts
|
* and by vertical overflowing layouts
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
@ -555,8 +519,8 @@ clutter_flow_layout_class_init (ClutterFlowLayoutClass *klass)
|
|||||||
* ClutterFlowLayout:row-spacing:
|
* ClutterFlowLayout:row-spacing:
|
||||||
*
|
*
|
||||||
* The spacing between rows, in pixels; the value of this
|
* The spacing between rows, in pixels; the value of this
|
||||||
* property is honoured by vertical non-wrapping layouts and
|
* property is honoured by vertical non-overflowing layouts and
|
||||||
* by horizontal wrapping layouts
|
* by horizontal overflowing layouts
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
@ -684,8 +648,7 @@ clutter_flow_layout_new (ClutterFlowOrientation orientation)
|
|||||||
*
|
*
|
||||||
* The orientation controls the direction used to allocate
|
* The orientation controls the direction used to allocate
|
||||||
* the children: either horizontally or vertically. The
|
* the children: either horizontally or vertically. The
|
||||||
* orientation also controls the direction of the wrapping
|
* orientation also controls the direction of the overflowing
|
||||||
* in case #ClutterFlowLayout:wrap is set to %TRUE
|
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
@ -731,60 +694,6 @@ clutter_flow_layout_get_orientation (ClutterFlowLayout *layout)
|
|||||||
return layout->priv->orientation;
|
return layout->priv->orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_flow_layout_set_wrap:
|
|
||||||
* @layout: a #ClutterFlowLayout
|
|
||||||
* @wrap: whether the layout should wrap
|
|
||||||
*
|
|
||||||
* Sets whether the @layout should wrap its children when
|
|
||||||
* allocating them
|
|
||||||
*
|
|
||||||
* The direction of the wrapping is controlled by the
|
|
||||||
* #ClutterFlowLayout:orientation property
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_flow_layout_set_wrap (ClutterFlowLayout *layout,
|
|
||||||
gboolean wrap)
|
|
||||||
{
|
|
||||||
ClutterFlowLayoutPrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_FLOW_LAYOUT (layout));
|
|
||||||
|
|
||||||
priv = layout->priv;
|
|
||||||
|
|
||||||
if (priv->layout_wrap != wrap)
|
|
||||||
{
|
|
||||||
ClutterLayoutManager *manager;
|
|
||||||
|
|
||||||
priv->layout_wrap = wrap;
|
|
||||||
|
|
||||||
manager = CLUTTER_LAYOUT_MANAGER (layout);
|
|
||||||
clutter_layout_manager_layout_changed (manager);
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (layout), "wrap");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_flow_layout_get_wrap:
|
|
||||||
* @layout: a #ClutterFlowLayout
|
|
||||||
*
|
|
||||||
* Gets whether @layout should wrap
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the #ClutterFlowLayout is wrapping
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_flow_layout_get_wrap (ClutterFlowLayout *layout)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_FLOW_LAYOUT (layout), FALSE);
|
|
||||||
|
|
||||||
return layout->priv->layout_wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_flow_layout_set_homogeneous:
|
* clutter_flow_layout_set_homogeneous:
|
||||||
* @layout: a #ClutterFlowLayout
|
* @layout: a #ClutterFlowLayout
|
||||||
|
@ -98,9 +98,6 @@ ClutterLayoutManager * clutter_flow_layout_new (ClutterFlowOrient
|
|||||||
void clutter_flow_layout_set_orientation (ClutterFlowLayout *layout,
|
void clutter_flow_layout_set_orientation (ClutterFlowLayout *layout,
|
||||||
ClutterFlowOrientation orientation);
|
ClutterFlowOrientation orientation);
|
||||||
ClutterFlowOrientation clutter_flow_layout_get_orientation (ClutterFlowLayout *layout);
|
ClutterFlowOrientation clutter_flow_layout_get_orientation (ClutterFlowLayout *layout);
|
||||||
void clutter_flow_layout_set_wrap (ClutterFlowLayout *layout,
|
|
||||||
gboolean wrap);
|
|
||||||
gboolean clutter_flow_layout_get_wrap (ClutterFlowLayout *layout);
|
|
||||||
void clutter_flow_layout_set_homogeneous (ClutterFlowLayout *layout,
|
void clutter_flow_layout_set_homogeneous (ClutterFlowLayout *layout,
|
||||||
gboolean homogeneous);
|
gboolean homogeneous);
|
||||||
gboolean clutter_flow_layout_get_homogeneous (ClutterFlowLayout *layout);
|
gboolean clutter_flow_layout_get_homogeneous (ClutterFlowLayout *layout);
|
||||||
|
Loading…
Reference in New Issue
Block a user