Commit Graph

65 Commits

Author SHA1 Message Date
Sungtaek Hong cb25699dac efl_ui_legacy: add new interface to indicate legacy widget
Summary:
For now, how to check whether a widget is legacy or not
is to check flags in private data or static flag, which is set
during elm_legacy_add.
If Efl.Ui.Legacy interface is added, it can be easilly checked
by efl_isa(obj, EFL_UI_LEGACY_INTERFACE)

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5748
2018-01-24 18:14:26 +09:00
Jean-Philippe Andre a92186be6a ecore/edje/elm: Fix a few WRN from calls to NULL
This fixes some of the warnings generated by calling functions on NULL
objects. One of the main remaining points is to avoid unwanted warnings
on non-existing parts.

Ref T6326
2018-01-16 18:37:05 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Jean-Philippe Andre c2a5ee65d5 elm: Fix duplicate EO API
elm_interface_scrollable is used by legacy but isn't public API.
2017-12-20 15:26:22 +09:00
Cedric BAIL d614894d04 ecore: rename efl_loop_Eina_FutureXXX_job to efl_loop_job. 2017-12-11 14:04:09 -08:00
Cedric BAIL 0cb8bde34a elementary: use Eina.Future based job. 2017-12-11 14:04:09 -08:00
Carsten Haitzler 01ec011f8e elm ifrace scrollable - fix uninitialized values on scroll asjust
dragable values were invalid (not fetched) so vx/y were junk and this
was making decisions based on that. guarantee it to be 0.

@fix
2017-11-24 23:52:08 +09:00
Sungtaek Hong 8f2369c5b6 efl_ui_widget: secure elm_legacy_add flag
Summary:
_elm_legacy_add goes back to EINA_FALSE after setting sd->legacy.
if constructor get called again after going back to EINA_FALSE,
sd->legacy should remain EINA_TRUE.
also, elm_legacy_add() should not be called non-elm_widget.

Test Plan:
Run elementary test->Efl.Ui.Text.Label.
Check legacy flag in _elm_theme_object_set() for efl_ui_win.
Check legacy flag for efl_ui_text after scrollable text is added.

Reviewers: jpeg, woohyun

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5529
2017-11-24 14:32:36 +09:00
Jean-Philippe Andre d39bbc1491 elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set:
if the widget is legacy or pure eo we may need to select a different
style. So in the constructor we need to know whether we are legacy or
eo. Note that calling style_set in finalize only is too late as we would
lose information such as efl_text_set() called inside efl_add().
2017-11-07 14:50:31 +09:00
Jean-Philippe Andre 2f465e1fbb widget: Rename EO APIs to efl_ui_widget_xxx
This only changes the eo_prefix for APIs.

Ref T5363
2017-10-24 14:30:21 +09:00
Marcel Hollerbach 3184e0f550 elm_interface_scrollable: do not scroll to a focused element by default
this can be done in the implementing other widgets
2017-10-19 15:20:59 +02:00
Marcel Hollerbach 56e9f582b6 elm_interface_scrollable: make sure this region is really visual
right now we just request the complete geom to be visible since there
seems to be no way ot checking where the new widgets will be in. This
needs some improvements.
2017-10-19 10:04:59 +02:00
Marcel Hollerbach 0fb1d6e1fa elm_interface_scrollable: fix bringing in of a focused item
you also need to calculate in the object position
2017-10-17 17:49:48 +02:00
Marcel Hollerbach d15ee47db0 elm_interface_scrollable: use focus_geometry not normal geometry 2017-10-10 22:25:21 +02:00
Jean-Philippe Andre 4c0167916b focus: Avoid infinite loop in window
I kept the safety error message for easier debugging.
Test scenario:
  elementary_test -to "Window Inline"
  Click on an entry. Press Shift+Tab.

Ping @bu5hm4n
2017-10-10 19:32:50 +09:00
Jean-Philippe Andre 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre 6d0957b0a5 widget: Rename focus_manager_factory to create
factory is not a verb :)

Ref T5363
2017-09-13 13:43:55 +09:00
Jean-Philippe Andre 7ef714924a evas: Fix crash with smart objects
This is due to the previous patches.
2017-09-13 09:57:05 +09:00
Jean-Philippe Andre 8572cd5def evas/edje/elm: Remove all uses of clipped groups
This removes the uses of the *EO* class, obviously not the use of the
clipped smart objects.
2017-09-13 09:57:05 +09:00
Marcel Hollerbach b846545072 efl_ui_focus_manager_sub: make it a mixin
This just brings the functionality, the manager that is used as sub can
still be decided and be brought in via inheritance or compositition
2017-09-02 20:06:15 +02:00
Jean-Philippe Andre 692282e67a widget: Move item_loop_enabled to scrollable (EO)
I was told that the scrollable interface is being redesigned for EO.
This API definitely does not belong to the base Widget class, as it's
quite specific to item-based scrollable widgets, such as lists and
grids. Since Elm.Interface_Scrollable is itself being revamped, it is a
good place to move that EO API for now.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 6bb9f4fd16 widget: Remove scroll_lock from EO
1. Uniformize the API, which is now for internal use:
   This uses the same enum as scroller "movement_block" instead
   of 2 separate properties. Less APIs, more consistence.

2. Remove scroll_lock x/y from EO widget. I was told it is not going to
   exist in the upcoming scrollable interface.

3. Remove scroll hold/freeze getters.
   scroll hold/freeze push/pop are still there but it remains to be seen
   how the EO scrollable interface will exploit them. Right now they are
   full of bugs.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre ffa041fe58 scroll: Rename elm enum to efl.ui
This scroll block enum should also be used in widget itself.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre c690469fcc widget: Rename drag_lock to scroll_lock (EO)
This also includes the drag_child_lock APIs. This had nothing to do with
dragging beyond maybe the case where scrolling is done by thumbscroll
(ie. finger drag).

Note that the EAPI were called already scroll_lock, not drag_lock.

Ref T5363
2017-08-30 17:29:52 +09:00
Hosang Kim 4b74a4cd55 scroller: fix getting content position.
Summary:
Widgets that don't have content like as genlist, gengrid.
They don't have geometry of content also.
So position of pan will be used when calculating postion to scroll.

Test Plan:
tested in elementary_test and check working properly.
this may be the problem when extern pan set on scrollable interface.

Reviewers: SanghyeonLee, cedric, felipealmeida, larry, bu5hm4n

Reviewed By: SanghyeonLee

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5127
2017-08-25 14:53:09 +09:00
Jean-Philippe Andre 964fafe429 widget: Remove parents_bounce from EO
It's specific to scroller and can be implemented there. Moved.

Ref T5363
2017-08-23 11:16:45 +09:00
Marcel Hollerbach df3d0e3d7b efl_ui_focus_manager: make focus a property 2017-08-10 20:56:04 +02:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Marcel Hollerbach af858d1d93 elm_widget: add factory method to the widget
with this function you can trap the creation of the mangers, and change
the behaviour as you need it. For example returning a custom manager.
2017-06-09 10:16:19 +02:00
junsu choi d1e5bd2727 Revert "scroller : fix mirrored contents_pos_set call"
Summary:
This reverts commit de313d6296.

Because x-coordination mirroring is called properly from wanted_regison_set.
There was a problem in scroller init process.
Before edje_obj was initialize in elm_interface_scrollable_objects_set, mirrored_set was being called.
So Move mirrored_set after elm_interface_scrollable_objects_set
it can fix this issue(https://phab.enlightenment.org/D4944)

Reviewers: raster, woohyun, SanghyeonLee, akanad, eagleeye, cedric, singh.amitesh, eunue

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D4945
2017-06-07 15:17:45 +09:00
junsu choi de313d6296 scroller : fix mirrored contents_pos_set call
Summary:
Fixes that a scroller can not be moved normally even if it is changed to mirrored.
In elm_scroller, _mirrored_set is called when sizing_eval is called. because
When content size is changed, it should be scrolled based on mirrored coordinates.
Also In elm_interface_scrollable,
elm_interface_scrollable_content_pos_set of _elm_scrollable_mirrored_set
to be called regardless of mirrored state.

Test Plan: scroller test on elementary_test.

Reviewers: raster, woohyun, SanghyeonLee, akanad, eagleeye, cedric, singh.amitesh, eunue

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4908

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 14:19:34 -07:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Marcel Hollerbach fb6c37f16f elementary: introduce helper functions for the redirects 2017-04-20 14:38:59 +02:00
Marcel Hollerbach 7994fa3f68 elm_interface_scrollable: fix bringing in of items 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 44e40c7c5e elm_interface_scrollable: use the submanager to register the children
this adds the registered elements at the broder of the scrollable to the
parents manager. scroller and gengrid works for registering
2017-04-20 14:38:58 +02:00
Jean-Philippe Andre a5e019b468 scroller: Fix issues with looping and paging
Prerequisites:
  Disable scroll animation (in elementary_config)

Test case:
  elementary_test -to Scroller

1. Scroll with the mouse wheel. Scrolling will not loop or anything.
2. Enable loop in Y, scroll to the top and to the bottom, verify
   that scrolling loops fine and shows the last and first page in
   full.
3. Enable page snapping, and repeat 2.

FIXME: Page snapping doesn't do much if you use thumbscroll or
       drag the scrollbars.

FIXME: In the test case, Y +/- 1 is useless as the scroller snaps
       to the pages even without snapping enabled.

@fix
2017-04-12 17:07:48 +09:00
Jean-Philippe Andre 0cd610af20 scroller: Fix freeze after dragging bars
The freeze property is a set() only but could internally
be reset to false, after dragging a vertical or horizontal slider.

Test scenario:
  elementary_test -to scroller

Click Freeze, test the mouse wheel (can't do anything), drag a
scroller side bar, test the mouse wheel again.

Before this patch, the scroller would scroll. After the patch, the
scroller remains fixed, respecting the value of freeze.

FIXME: It is possible that the proper fix would be to disable
       bars drag during freeze, but that is not the case currently.

NOTE: freeze, hold, movement_block, lock_x/y have very similar
      meanings. The doc really needs clarification here, and some
      property might be removed. Also, freeze and hold have no
      getter, only a setter. drag_lock_x/y is part of elm_widget,
      and not specific to scrollers.
2017-04-12 15:18:24 +09:00
Jean-Philippe Andre 59cf7c7ab7 scroller: Fix CRI if scroll animation is disabled
If the scroll animation is disabled, we ended up with an
immediate call from inside a post-event callback to modify
the canvas geometry which led to feeding events. Since
99d21f6d9c and 54e5841b2f it is basically forbidden
to modify the canvas or feed events from the post-event cb.
This is because feeding events from inside the post-event
callback can break the logical order of operations between
post-event cb and event cb.

Note: This also implements no-animation scrolling for page
scroll, in case scroll animation is disabled (unifying the
code did that).

Fixes T5289 (abort inside E)
2017-04-12 14:54:15 +09:00
Jean-Philippe Andre bc4f803d37 scroller: Fix wheel scroll with imbricated H+V scrollers
Test scenario:
 elementary_test -to "Scroller 2"

Use the mouse wheel to scroll inside the horizontal scroller
(the one with many "...Horizontal scrolling..." buttons). This
scroller should scroll horizontally. When reaching the end of
this scroller, the main vertical scroller should take over
and scroll vertically, but only after a 0.5s timeout has passed.

Before this patch, you could wait forever and scrolling inside
the horizontal scroller would never trigger a scroll in the main
vertical scroller, despite reaching the end point.

In 1.18 both the main and the horizontal scrollers scroll
simultaneously. The imbricated vertical scrollers seem to work
as designed, but not H inside V.

@fix
2017-04-12 14:32:33 +09:00
Jean-Philippe Andre bc31a47fd9 elm: Restore ABI compatibility (elm_pan_gravity)
elm_pan_gravity_{set,get} are functions that were generated as
legacy APIs (in other words EAPI), but were never actually exposed
to applications as they were protected behind EFL_EO_API_SUPPORT
(see elm_interfaces.h).

This patch restores the ABI compatibility with elementary 1.18.
2017-02-23 15:43:56 +09:00
Wonki Kim 80e3c643d8 interface_scrollable: Improve gravity_set api to support pan changing
Summary:
When you set gravity 1 on scroller, scroller sticks to the bottom
even content is changed.
however, scroller don't work like above, if size of pan is changed.

this commit uses pan_pos_max rather than w/h of content_info
because pan_pos_max is related with both content_size and pan size.

gravity_set will work properly even if both size of content and pan are
changed simultaneously.

Test Plan:
1. Select 'scroll3' in the elementary_test
2. Append enough items so that scroll bar appears (about 30 items)
3. Go to the bottom and Set gravity 1.0
4. Check that scroller sticks to the bottom once you append another item
   (it works)
5. Check that scroller sticks to to bottom once you resize window(pan)
   (it doesn't work without this patch)

Reviewers: eagleeye, jpeg, cedric, woohyun, z-wony, herdsman

Differential Revision: https://phab.enlightenment.org/D4665
2017-02-20 11:38:02 +09:00
Wonki Kim fbad285eca interface_scrollable: Unify basis of calculation of page_get logic
Summary:
If rtl mode is set, current_page_get api should return reversed page number.
To do that, make x position x-axis reversed before page calculating.

Also bring_in and page_show should show the reversed page in rtl mode.
This patch modify the functions to support that.

Lastly, scroller should be scrolling based on the right edge of the page.

This patch is a combination of the patches(D4559,D4560)

Test Plan:
1. Run scroller test on elementary_test
2. Turn ui mirrored mode on
3. Manipulate scroller in various ways
    - It should scroll proper position when you click next or prev btn.

Reviewers: woohyun, taxi2se, z-wony, cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4558
2017-01-16 14:20:04 +09:00
Hosang Kim 2b3bee1301 scrollable_interface: fixed logic for calcualting position to scroll.
Summary:
When width of parameter(w) is bigger than or equal to scroller's width(pw),
scrollable object must be scrolled to x position.

Test Plan: elementary_test -> focus 4

Reviewers: woohyun, SanghyeonLee, Hermet, cedric, jpeg, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4491
2016-12-16 15:26:00 -08:00
soohye e0e0c892d2 scrollable_interface: fixed last_page_get() API
Summary: ceiling the vaule of content size divided by page size

Reviewers: cedric, jpeg, Hermet

Reviewed By: Hermet

Subscribers: minkyu, sju27, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4447
2016-12-06 13:34:53 +09:00
Mike Blumenkrantz f116310757 elm scrollable: return correct values from post event callbacks
post event callbacks must return 0 to stop processing when an event is
consumed, and 1 when processing should continue. this is the only place in
all of efl which used this functionality, and it did so incorrectly.

@fix

ref 248b6beeee
ref D2393
2016-11-03 11:42:26 -04:00
Jean-Philippe Andre fb797611ed scroller: Adjust rare case when content fits but bars are visible
This was simply annoying me. A scroller packed inside a box 150x150
should have enough space to hold an object of size 140x140. That's
a whole lot of 10 pixels margin!

This patch adds a special case code when the content "seems" to fit
inside the box but still one or both bars are visible. One problem
is that we can't know from the theme how much margin is used by a
scroller even when its bars are hidden. So we have to try to remove
them and then recalc to test.

This definitely adds quite a few more calculations if the state of
the scroll bars changes, but the result is way more pleasant :) This
should be limited to corner cases anyway (when the content size is
within 0 to ~20 pixels of the scroller size, depending on the theme
of course).

The test case is adjusted to show that same size content triggers
a show on the bars (because of theme margins). See CtxPopup test.
2016-10-27 10:02:56 +09:00
Jean-Philippe Andre 8a9f0bd603 evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
 - intercept
 - smart resize (do stuff), super, super, super
 - evas object resize

The new code is more like:
 - intercept
 - super, super, super, evas object resize
 - do stuff

But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 11b7cf6b72 evas/elm: Remove function group_move
This is an override of efl_gfx_position_set.
As for the other patches, I hope I didn't break anything.

A problem likely to happen is that the super call was inserted
too early or too late in the call flow. For instance:

  _myclass_position_set(obj, x, y) {
    position_set(super(obj), x, y);
    position_get(obj, &prevx, &prevy);
    do_something_with_delta_xy();
  }

The above code flow is obvisouly wrong, but may have crept in this
patch (such a bug sneaked in inside smart object, breaking
everything at first).
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 97c9fa64a4 evas/elm: Remove group_show and group_hide
These should be just overrides of Efl.Gfx.visible.set. Many
widgets were handling smart show() and hide() manually, which
means this patch is quite large.

Hopefully this doesn't break anything, obviously. But here are
some widgets known to be problematic, as the old code flow was
really strange (sometimes not calling the efl_super function):
 - window
 - notify
2016-10-12 11:25:56 +09:00