GNOME Bugzilla – Bug 648873
Feature request: ClutterFlowLayout not aligning on a grid
Last modified: 2013-05-13 19:20:44 UTC
Created attachment 186819 [details] flow.c At the moment, ClutterFlowLayout can only align its children on a grid. It would be nice if it could place one item just next to the previous one without losing space. The attached test program and the screenshot show the problem.
Created attachment 186820 [details] ClutterFlowLayout.png This screenshot shows the problem: - There is lost space between "Open" and "Eject" - There is enough space to put the "?" button after the "Kill" button but it goes on a new line
There is a "homogeneous" property, that might go some way?
Well never mind, I had the older screenshot from the devices panel in mind.
I'd accept a patch that added a :snap-to-grid property (default=true) that, when set to false, would not assign to every row/column the minimum and natural size computed based on the biggest child.
Created attachment 216084 [details] [review] flow-layout: Add :snap-to-grid property Here's an initial patch for the _not_ snap to grid functionality. It's quite untested an may contain some unwanted features. ClutterFlowLayout also needs some revamp to properly support ClutterActor's expand settings
Created attachment 241355 [details] [review] flow-layout: Add :snap-to-grid property Add a :snap-to-grid property to FlowLayout to prevent the layout from assigning it's children a position based on the size of the largest child. Updated to clutter-1.14 branch
Created attachment 242818 [details] [review] Updated to master
Created attachment 242820 [details] [review] Fixes
(In reply to comment #6) > Created an attachment (id=241355) [details] [review] > flow-layout: Add :snap-to-grid property > > Add a :snap-to-grid property to FlowLayout to prevent the layout from > assigning it's children a position based on the size of the largest > child. > > > Updated to clutter-1.14 branch This patch made by Bastian already solve the issue of ClutterFlowLayout not respecting expands flags of its children.
Review of attachment 242818 [details] [review]: ::: clutter/clutter-flow-layout.c @@ +1065,3 @@ + * on a grid + * + * Since: 1.12 Since: 1.16 @@ +1511,3 @@ + * @snap_to_grid: %TRUE if the @layout should place its children + * on a grid + * missing description. something like: Whether the @layout should lay the children using a grid. @@ +1512,3 @@ + * on a grid + * + * Since: 1.12 Since: 1.16 @@ +1538,3 @@ + * clutter_flow_layout_get_snap_to_grid: + * @layout: a #ClutterFlowLayout + * missing description. something like: Retrieves the value set using clutter_flow_layout_set_snap_to_grid(). @@ +1542,3 @@ + * a grid + * + * Since: 1.12 Since: 1.16 ::: clutter/clutter-flow-layout.h @@ +105,3 @@ gfloat *min_height, gfloat *max_height); +CLUTTER_AVAILABLE_IN_1_12 need to be updated to CLUTTER_AVAILABLE_IN_1_16 @@ +108,3 @@ +void clutter_flow_layout_set_snap_to_grid (ClutterFlowLayout *layout, + gboolean snap_to_grid); +CLUTTER_AVAILABLE_IN_1_12 same as above.
Review of attachment 242820 [details] [review]: should be a separate patch against master.
(In reply to comment #10) > Review of attachment 242818 [details] [review]: > So, basically, this one should be patch against clutter-1.16 branch ?
Created attachment 243229 [details] [review] flow-layout: Add snap_to_grid. Clutter-1.16 branch
Created attachment 243231 [details] [review] flow-layout: Add snap_to_grid. Clutter-2 branch
Review of attachment 243229 [details] [review]: looks good; tested on clutter-1.16, I think we can commit this.
Review of attachment 243229 [details] [review]: it's missing symbols and docs fixes, though.
Review of attachment 243231 [details] [review]: looks good.
Created attachment 243529 [details] [review] flow-layout: Add snap_to_grid. Clutter-1.16 branch Added doc and clutter.symbols fix.
Review of attachment 243529 [details] [review]: looks good.
everything landed in master