efl_ui_selectable: split this up
i dont know why, but something got badly mixed up, the selection APIs
for text and item ended up in the same interface, which seems ... weird
?
This commit splits that up into container_selectable and
text_selectable, there is no future plan on my list for text_selection.
The rest of this series is working towards removing
container_selectable, replacing it with a new interface. However, the
interface will stay until list_view is replaced.
The changes in the legacy code are removing the efl.ui.selection
interface from it, item emission is not depending on the inherited
interfaces, additionally, this interface does not provide any API, so
this should not be an issue.
ref T7766
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9498
2019-08-05 09:35:13 -07:00
|
|
|
abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Container_Selectable, Efl.Input.Clickable
|
2018-04-22 23:13:59 -07:00
|
|
|
{
|
2019-07-29 06:56:27 -07:00
|
|
|
[[Selectable Item abstraction.
|
|
|
|
|
|
|
|
This class serves as the basis to create widgets acting as selectable items inside containers
|
|
|
|
like @Efl.Ui.List or @Efl.Ui.Grid, for example.
|
|
|
|
@Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin.
|
|
|
|
Items can be pressed, long-pressed, etc, and appropriate events are generated.
|
efl_ui_selectable: split this up
i dont know why, but something got badly mixed up, the selection APIs
for text and item ended up in the same interface, which seems ... weird
?
This commit splits that up into container_selectable and
text_selectable, there is no future plan on my list for text_selection.
The rest of this series is working towards removing
container_selectable, replacing it with a new interface. However, the
interface will stay until list_view is replaced.
The changes in the legacy code are removing the efl.ui.selection
interface from it, item emission is not depending on the inherited
interfaces, additionally, this interface does not provide any API, so
this should not be an issue.
ref T7766
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9498
2019-08-05 09:35:13 -07:00
|
|
|
@Efl.Ui.Item also implements the @Efl.Ui.Container_Selectable interface, meaning that "selected" and
|
2019-07-29 06:56:27 -07:00
|
|
|
"unselected" events are automatically generated.
|
|
|
|
|
|
|
|
Classes inheriting from this one only need to deal with the visual representation of the widget.
|
|
|
|
See for example @Efl.Ui.Grid_Default_Item and @Efl.Ui.List_Default_Item.
|
|
|
|
|
|
|
|
Some events are converted to edje signals so the theme can react to them:
|
|
|
|
@[Efl.Input.Clickable.pressed] -> "efl,state,pressed",
|
|
|
|
@[Efl.Input.Clickable.unpressed] -> "efl,state,unpressed",
|
efl_ui_selectable: split this up
i dont know why, but something got badly mixed up, the selection APIs
for text and item ended up in the same interface, which seems ... weird
?
This commit splits that up into container_selectable and
text_selectable, there is no future plan on my list for text_selection.
The rest of this series is working towards removing
container_selectable, replacing it with a new interface. However, the
interface will stay until list_view is replaced.
The changes in the legacy code are removing the efl.ui.selection
interface from it, item emission is not depending on the inherited
interfaces, additionally, this interface does not provide any API, so
this should not be an issue.
ref T7766
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9498
2019-08-05 09:35:13 -07:00
|
|
|
@[Efl.Ui.Container_Selectable.item,selected] -> "efl,state,selected",
|
|
|
|
@[Efl.Ui.Container_Selectable.item,unselected] -> "efl,state,unselected".
|
2019-07-29 06:56:27 -07:00
|
|
|
]]
|
2018-04-22 23:13:59 -07:00
|
|
|
methods {
|
|
|
|
@property index {
|
2019-07-29 06:56:27 -07:00
|
|
|
[[The index of this item inside its container.
|
|
|
|
|
|
|
|
The container must be set through the @Efl.Ui.Item.container property.]]
|
2018-04-22 23:13:59 -07:00
|
|
|
get {}
|
|
|
|
values {
|
2019-07-29 06:56:27 -07:00
|
|
|
index : int; [[The index where to find this item in its $container.]]
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property selected {
|
2019-07-29 06:56:27 -07:00
|
|
|
[[Item selected state.
|
|
|
|
|
|
|
|
The visual representation of the item will be adjusted accordingly to the new state.
|
|
|
|
This property is also automatically modified in response to user actions.
|
|
|
|
]]
|
2018-04-22 23:13:59 -07:00
|
|
|
values {
|
2019-07-29 06:56:27 -07:00
|
|
|
select: bool; [[Whether this item is selected or not.]]
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
}
|
2019-07-10 07:30:04 -07:00
|
|
|
@property container {
|
|
|
|
[[The container this object is part of.
|
|
|
|
|
2019-07-29 06:56:27 -07:00
|
|
|
You should never use this property directly, the container will set it when the
|
|
|
|
item is added.
|
|
|
|
Unsetting this while the item is packed inside a container does not remove the item
|
|
|
|
from the container.
|
2019-07-10 07:30:04 -07:00
|
|
|
]]
|
|
|
|
values {
|
|
|
|
container : Efl.Ui.Widget; [[The container this item is in.]]
|
|
|
|
}
|
|
|
|
}
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
implements {
|
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.finalize;
|
|
|
|
Efl.Object.destructor;
|
|
|
|
}
|
|
|
|
}
|