Page MenuHomePhabricator

Refactor elm_panes
Closed, ResolvedPublic

Description

elm_panes being a useful object should be back in Efl.Ui. It should inherit from one of the container API that makes sense.

cedric raised the priority of this task from TODO to High.Jul 10 2017, 2:24 PM

APIs content_left_size and content_right_size should be renamed to more meaningful.

jpeg added a comment.Jul 31 2017, 8:28 PM

We have basically 3 APIs:

  1. content_left_size is same as content_right_size in that only one can be set at the same time (left == 1.0 - right)
  2. content_left_min_relative_size and...
  3. ...content_left_min_size are 1D min size APIs. The absolute (in pixels) min size can be common with slider and progress bar (the "span size"). But here these are part APIs: one for the left and one for the right.

I believe the left/right absolute min size is not useful, as the min size really should depend on the content, and that is not orientation agnostic. The min size can be set by the user on the content, and EFL can then respect that.[*] I think we should get rid of the content_min_size set of APIs, in EO.

Left/right relative min sizes can be defined either:

  • In a new interface with just those 2 APIs for 1D min size hints (1D relative min size is hard to apply anywhere else, though)
  • Simply in the "part" class implementation of Efl.Ui.Panes.Part. Right now Efl.Canvas.Layout_Internal (to be renamed Efl.Canvas.Layout.Part) already exhibits such APIs that are not defined in an interface.

The min size of a side should be the resulting max of the relative and content min size.
Note that right now panes don't respect the content min size and just clip things, which can result in really weird layouts (visible in eg. in Edi's file panel). So we could either add a flag to support those or just let the user set the user min size (this is Efl.Gfx.Size_Hints.min_size).

Finally,
I believe the part names are not good. "left" and "right" don't apply when the widget is in "horizontal" mode (i.e. a horizontal splitting bar) where the parts are "top" and "bottom". I think "first" and "second" would be better. Or anything else that is orientation neutral.

I already discussed this IRL with @singh.amitesh and @SanghyeonLee so online comments are more than welcome!

singh.amitesh added a comment.EditedAug 10 2017, 7:14 PM

I am summerizing the work done on panes widget.

  1. ranmed to Efl.Ui.Panes 40945d985967e58d6e6c00ecfd6292a8d67b83b5
  2. add first and second as content aliases 46d4df4962a723f12723a901b0d2ae2966ebb7ad
  3. allow panes to respect the min size of its content 0ca98280d4b041e277d071ecfbcbc77db2eaa7cd
  4. implement allow_user_size_hints on parts aaaf1a282a82f2f10b01f561ea210d5643707a1a
  5. rename left/right_size_set to split_ratio & implements min_split_ratio on parts. 599bb616ec501bacd5af8cae3c9e5226509b3303
  6. don't use edje restrict cal to calculate min size 521e2ab83ce0949de8101602d3596f30b7650bcb
singh.amitesh added a comment.EditedAug 13 2017, 6:04 PM

Panes theme needs to be changed.
Currently panes direction is in reference to the side bar orientation. I think it should be
according to the layout of its contents (first and second). We should fork out a task for theme.

refer T5870

jpeg added a comment.Aug 15 2017, 7:57 PM

So basically create a theme for "efl" namespace (EO API).
Prior to that you may need to build the infra inside elementary to select "efl" groups from EDC rather than "elm/". I'm very worried about this.
See T5810

It would be nice to have following feature in panes which @jpeg has already suggested before.
Please have a look at below video.

can we close this? i think its completed.

jpeg added a comment.Sep 18 2017, 7:32 PM

I think it's in pretty good shape now, indeed. A few comments though:

  1. Event names:
events {
   press; [[Called when panes got pressed]]
   unpress; [[Called when panes are no longer pressed]]
}

Are press/unpress consistent? Shouldn't we use pressed/unpressed? I know usually click event is "clicked".

  1. Did you open a Wishlist ticket for the missing features we discussed before?

Proper min size handling (your test case with 3 panes) and the auto hide / show of a half pane when dragged forcefully.

  1. The EO theme isn't done yet.

It must have vertical/horizontal in a meaningful way, and be namespaced "efl/".

singh.amitesh added a comment.EditedSep 19 2017, 1:47 AM
In T5359#98754, @jpeg wrote:

I think it's in pretty good shape now, indeed. A few comments though:

  1. Event names: ` events { press; Called when panes got pressed unpress; Called when panes are no longer pressed } `

Its "press" and "unpress" in other widgets as well. Should we rename it to "pressed" and "unpressed" at all places?

Are press/unpress consistent? Shouldn't we use pressed/unpressed? I know usually click event is "clicked".

  1. Did you open a Wishlist ticket for the missing features we discussed before? Proper min size handling (your test case with 3 panes) and the auto hide / show of a half pane when dragged forcefully.

T6045

  1. The EO theme isn't done yet. It must have vertical/horizontal in a meaningful way, and be namespaced "efl/".

Should i do in this widget? or do we have common architecture for handling "efl/" prefixed themes?

jpeg closed this task as Resolved.Dec 11 2017, 6:14 PM

See e7e375937be40e543967ad32b4bb4dd533f3ab92.
See D5566

This is now resolved.