Commit Graph

9 Commits

Author SHA1 Message Date
Jean-Philippe Andre b1488b98de efl.ui.box: Switch to Efl.Ui.Dir (EO)
This makes the default box vertical, just like in legacy.
The flow box is horizontal by default.

Ref T5870
2017-08-10 14:42:08 +09:00
Jean-Philippe Andre acb9ae70fe eo/elm: Simplify box/grid EO API
After talking with @eunue I realised that the way I'd first
implemented the box/grid "pack" API was simply too complicated.
I had tried to make it possible to change the layout function
at runtime, like good old evas box, but since there are no function
pointers in EO the final design was really convoluted.

If someone really needs to change the layout of a box at runtime,
just create your own subclass, or unpack all items and repack them
in a new box.

Note: there are still some issues with the layout params & flow
2017-04-18 15:34:29 +09:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jean-Philippe Andre 2d946d03ae Efl.Pack: Rename methods and properties
- Children are now contents
- Efl.Pack_Layout is now a separate class and
  merges Pack_Engine.
- Removed dumb class Efl.Pack_Item
- Updated docs
- Added pack_ or grid_ prefixes to some methods
2016-04-20 11:15:53 +09:00
Jean-Philippe Andre e4889ca367 Ui.Box: Fix flow layout
Set align, fix usage with eo_add(EFL_UI_BOX_FLOW_CLASS).
2016-04-20 10:47:40 +09:00
Jean-Philippe Andre f2eff88640 Efl.Ui.Box: Add pack_align property
While at first I wanted to remove the box_align / table_align
properties, it ends up being a necessary value in some cases.
2016-04-20 10:47:40 +09:00
Jean-Philippe Andre 548efd7fa4 Efl.Ui.Box: Implement flow layouts
This reuses the Evas.Box code, since we are still using the
box internally. The flow layout function is far from perfect
(it works well only with items of same height).

This shows how to use specific layouts provided by EFL.
2016-04-20 10:47:40 +09:00
Jean-Philippe Andre 24eccb6d62 Efl.Ui.Box: Implement way to override layout function
So, since we don't have function pointers, all the solutions
to reimplementing the layout function are quite convoluted:

1. use events
2. reimplement layout func
3. use an extra object
4. use a generic class (non instanciated)

Promises don't apply here (layout will run multiple times).

Problems:

1. Multiple event callbacks will be called, resulting in
   potential performance impact, extra events, etc...
   Also, there is no way to define standard implementations
   that would be provided by the framework.

2. Reimplementation of a function requires extra EO work
   (create an EO class, etc...), doesn't allow on-the-fly
   change of the layout method.

3. Probably the best solution is to have an object implementing
   the layout. But this means creating an extra object along
   with the container.

4. To avoid the extra object, use a class, and reimplement
   a @class function. This unfortunately requires extra
   EO work.

Solution 4. has been selected, but it's not very nice...
2016-04-20 10:47:40 +09:00
Jean-Philippe Andre b18a993dc0 Efl.Ui.Box: Add implementation of a simple box
This should be the only linear packing container.
This replaces: evas box and elm box.

Edje box needs to be kept around for compatibility,
but it stays an EDC object only (for apps).

Lots of things are still to be fleshed out in this
box implementation:
- Simplify smart object / elm widget code
- Maybe stop using evas object box altogether
- Implement other layout strategies

@feature
2016-04-20 10:47:40 +09:00