widget: Rename focus_region (EO)
This region has little to do with focus, as it's more of a region of interest within the widget, and not directly related to the highlight geometry, for instance. It's related to focus in the sense that only widgets with focus would really care about this region. I decided to change this name after talking with @bu5hm4n. Note that gengrid uses this but is also completely broken (the focus highlight floats around and you don't even see the focused item). Note: This is very close to show_region but I'm not sure those can be merged safely (since the default "focus_region" is NULL while the default "show_region" is the widget's geometry). Ref T5363
This commit is contained in:
parent
19dff85519
commit
72f1fbf4f1
|
@ -1250,7 +1250,7 @@ _efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Objec
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Rect
|
EOLIAN static Eina_Rect
|
||||||
_efl_ui_text_elm_widget_focus_region_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
|
_efl_ui_text_elm_widget_interest_region_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
|
||||||
{
|
{
|
||||||
Evas_Coord edje_x, edje_y, elm_x, elm_y;
|
Evas_Coord edje_x, edje_y, elm_x, elm_y;
|
||||||
Eina_Rect r = {};
|
Eina_Rect r = {};
|
||||||
|
|
|
@ -361,7 +361,7 @@ class Efl.Ui.Text (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
|
||||||
Elm.Widget.on_access_activate;
|
Elm.Widget.on_access_activate;
|
||||||
Elm.Widget.theme_apply;
|
Elm.Widget.theme_apply;
|
||||||
Elm.Widget.on_focus_update;
|
Elm.Widget.on_focus_update;
|
||||||
Elm.Widget.focus_region { get; }
|
Elm.Widget.interest_region { get; }
|
||||||
Elm.Widget.on_disabled_update;
|
Elm.Widget.on_disabled_update;
|
||||||
Elm.Widget.widget_sub_object_del;
|
Elm.Widget.widget_sub_object_del;
|
||||||
Elm.Interface_Scrollable.policy { set; }
|
Elm.Interface_Scrollable.policy { set; }
|
||||||
|
|
|
@ -1308,7 +1308,7 @@ _elm_entry_elm_widget_on_focus_update(Eo *obj, Elm_Entry_Data *sd, Elm_Object_It
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Rect
|
EOLIAN static Eina_Rect
|
||||||
_elm_entry_elm_widget_focus_region_get(Eo *obj, Elm_Entry_Data *sd)
|
_elm_entry_elm_widget_interest_region_get(Eo *obj, Elm_Entry_Data *sd)
|
||||||
{
|
{
|
||||||
Evas_Coord cx, cy, cw, ch;
|
Evas_Coord cx, cy, cw, ch;
|
||||||
Evas_Coord edx, edy;
|
Evas_Coord edx, edy;
|
||||||
|
|
|
@ -960,7 +960,7 @@ class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
|
||||||
Elm.Widget.on_access_activate;
|
Elm.Widget.on_access_activate;
|
||||||
Elm.Widget.theme_apply;
|
Elm.Widget.theme_apply;
|
||||||
Elm.Widget.on_focus_update;
|
Elm.Widget.on_focus_update;
|
||||||
Elm.Widget.focus_region { get; }
|
Elm.Widget.interest_region { get; }
|
||||||
Elm.Widget.on_disabled_update;
|
Elm.Widget.on_disabled_update;
|
||||||
Elm.Widget.widget_sub_object_del;
|
Elm.Widget.widget_sub_object_del;
|
||||||
Elm.Interface_Scrollable.policy { set; }
|
Elm.Interface_Scrollable.policy { set; }
|
||||||
|
|
|
@ -141,10 +141,9 @@ enum Efl.Ui.Focus.Direction
|
||||||
last = 6
|
last = 6
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Elm.Focus.Region.Show_Mode
|
enum Efl.Ui.Interest_Region_Mode
|
||||||
{
|
{
|
||||||
[[Focus region show mode.]]
|
[[Focus region show mode.]]
|
||||||
legacy: elm_focus_region_show;
|
|
||||||
widget, [[As a widget.]]
|
widget, [[As a widget.]]
|
||||||
item, [[As an item.]]
|
item, [[As an item.]]
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,11 @@ typedef enum
|
||||||
ELM_OBJECT_LAYER_LAST /**< last layer known by Elementary */
|
ELM_OBJECT_LAYER_LAST /**< last layer known by Elementary */
|
||||||
} Elm_Object_Layer;
|
} Elm_Object_Layer;
|
||||||
|
|
||||||
|
/** How the focus region should be calculated (not related to input focus). */
|
||||||
|
typedef Efl_Ui_Interest_Region_Mode Elm_Focus_Region_Show_Mode;
|
||||||
|
#define ELM_FOCUS_REGION_SHOW_WIDGET EFL_UI_INTEREST_REGION_MODE_WIDGET
|
||||||
|
#define ELM_FOCUS_REGION_SHOW_ITEM EFL_UI_INTEREST_REGION_MODE_ITEM
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT;
|
EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT;
|
||||||
|
|
||||||
|
|
|
@ -3539,7 +3539,7 @@ _elm_gengrid_elm_widget_on_focus_update(Eo *obj, Elm_Gengrid_Data *sd, Elm_Objec
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Rect
|
EOLIAN static Eina_Rect
|
||||||
_elm_gengrid_elm_widget_focus_region_get(Eo *obj, Elm_Gengrid_Data *sd)
|
_elm_gengrid_elm_widget_interest_region_get(Eo *obj, Elm_Gengrid_Data *sd)
|
||||||
{
|
{
|
||||||
Eina_Rect r = {};
|
Eina_Rect r = {};
|
||||||
|
|
||||||
|
@ -3560,7 +3560,7 @@ _elm_gengrid_elm_widget_focus_region_get(Eo *obj, Elm_Gengrid_Data *sd)
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
return elm_obj_widget_focus_region_get(efl_super(obj, MY_CLASS));
|
return elm_obj_widget_interest_region_get(efl_super(obj, MY_CLASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool _elm_gengrid_smart_focus_next_enable = EINA_FALSE;
|
static Eina_Bool _elm_gengrid_smart_focus_next_enable = EINA_FALSE;
|
||||||
|
|
|
@ -550,7 +550,7 @@ class Elm.Gengrid (Efl.Ui.Layout, Elm.Interface_Scrollable,
|
||||||
Elm.Widget.theme_apply;
|
Elm.Widget.theme_apply;
|
||||||
Elm.Widget.on_access_update;
|
Elm.Widget.on_access_update;
|
||||||
Elm.Widget.on_focus_update;
|
Elm.Widget.on_focus_update;
|
||||||
Elm.Widget.focus_region { get; }
|
Elm.Widget.interest_region { get; }
|
||||||
Elm.Widget.widget_event;
|
Elm.Widget.widget_event;
|
||||||
Elm.Widget.focus_highlight_geometry { get; }
|
Elm.Widget.focus_highlight_geometry { get; }
|
||||||
Elm.Widget.focused_item { get; }
|
Elm.Widget.focused_item { get; }
|
||||||
|
|
|
@ -1050,7 +1050,7 @@ _elm_panel_toggle(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Rect
|
EOLIAN static Eina_Rect
|
||||||
_elm_panel_elm_widget_focus_region_get(Eo *obj, Elm_Panel_Data *sd)
|
_elm_panel_elm_widget_interest_region_get(Eo *obj, Elm_Panel_Data *sd)
|
||||||
{
|
{
|
||||||
Eina_Rect r = {};
|
Eina_Rect r = {};
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable,
|
||||||
Elm.Widget.on_disabled_update;
|
Elm.Widget.on_disabled_update;
|
||||||
Elm.Widget.on_access_update;
|
Elm.Widget.on_access_update;
|
||||||
Elm.Widget.widget_event;
|
Elm.Widget.widget_event;
|
||||||
Elm.Widget.focus_region { get; }
|
Elm.Widget.interest_region { get; }
|
||||||
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
|
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
|
||||||
Efl.Part.part;
|
Efl.Part.part;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1045,8 +1045,8 @@ _propagate_event_legacy(Eo *parent, const Efl_Event *event, Eo *obj, Elm_Event_C
|
||||||
* If elm_widget_focus_region_get() returns an empty rect (w or h <= 0),
|
* If elm_widget_focus_region_get() returns an empty rect (w or h <= 0),
|
||||||
* this function will ignore region show action.
|
* this function will ignore region show action.
|
||||||
*/
|
*/
|
||||||
EOLIAN static void
|
EAPI void
|
||||||
_elm_widget_focus_region_show(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
|
elm_widget_focus_region_show(Eo *obj)
|
||||||
{
|
{
|
||||||
Evas_Coord ox, oy;
|
Evas_Coord ox, oy;
|
||||||
Eina_Rect r;
|
Eina_Rect r;
|
||||||
|
@ -2532,7 +2532,7 @@ _elm_widget_show_region_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
|
||||||
* @ingroup Widget
|
* @ingroup Widget
|
||||||
*/
|
*/
|
||||||
EOLIAN static Eina_Rect
|
EOLIAN static Eina_Rect
|
||||||
_elm_widget_focus_region_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
|
_elm_widget_interest_region_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Eina_Rect r = {};
|
Eina_Rect r = {};
|
||||||
r.size = efl_gfx_size_get(obj);
|
r.size = efl_gfx_size_get(obj);
|
||||||
|
@ -3450,13 +3450,13 @@ _elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EIN
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_widget_focus_region_show_mode_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd, Elm_Focus_Region_Show_Mode mode)
|
_elm_widget_interest_region_mode_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd, Elm_Focus_Region_Show_Mode mode)
|
||||||
{
|
{
|
||||||
_pd->focus_region_show_mode = mode;
|
_pd->focus_region_show_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Elm_Focus_Region_Show_Mode
|
EOLIAN static Elm_Focus_Region_Show_Mode
|
||||||
_elm_widget_focus_region_show_mode_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
|
_elm_widget_interest_region_mode_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
|
||||||
{
|
{
|
||||||
return _pd->focus_region_show_mode;
|
return _pd->focus_region_show_mode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,14 +395,14 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
|
||||||
unchanged.
|
unchanged.
|
||||||
]]
|
]]
|
||||||
values {
|
values {
|
||||||
region: Eina.Rect; [[The region of interest.]]
|
region: Eina.Rect; [[The region to show.]]
|
||||||
force: bool; [[Set to $true to force show even if unchanged.]]
|
force: bool; [[Set to $true to force show even if unchanged.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get {
|
get {
|
||||||
[[Returns the current region of interest.]]
|
[[Returns the current region to show.]]
|
||||||
values {
|
values {
|
||||||
region: Eina.Rect; [[The region of interest.]]
|
region: Eina.Rect; [[The region to show.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -422,10 +422,10 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
|
||||||
[[Pop scroller freeze]]
|
[[Pop scroller freeze]]
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: This is not 100% related to focus. This documentation needs
|
/* Region of interest */
|
||||||
* further fixing. */
|
@property interest_region @protected {
|
||||||
@property focus_region @protected {
|
[[Region of interest inside this widget, that should be given
|
||||||
[[Region to show when focus changes within this widget.
|
priority to be visible inside a scroller.
|
||||||
|
|
||||||
When this widget or one of its subwidgets is given focus, this
|
When this widget or one of its subwidgets is given focus, this
|
||||||
region should be shown, which means any parent scroller should
|
region should be shown, which means any parent scroller should
|
||||||
|
@ -439,9 +439,10 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
|
||||||
widget. W,H must be greater or equal to 1 for this region to be
|
widget. W,H must be greater or equal to 1 for this region to be
|
||||||
taken into account, otherwise it is ignored.
|
taken into account, otherwise it is ignored.
|
||||||
|
|
||||||
See also @.focus_region_show.
|
See also @.interest_region_mode
|
||||||
]]
|
]]
|
||||||
get {
|
get {
|
||||||
|
legacy: elm_widget_focus_region_get;
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
region: Eina.Rect;
|
region: Eina.Rect;
|
||||||
|
@ -449,19 +450,25 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
|
||||||
will be ignored, and no action will be taken.]]
|
will be ignored, and no action will be taken.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
focus_region_show @protected {
|
@property interest_region_mode {
|
||||||
[[Show the region of interest inside this widget.
|
[[Defines how @.show_region should be calculated.
|
||||||
|
|
||||||
See also @.focus_region.
|
It is up to the implementation of @.show_region.get to take this
|
||||||
|
value into account (or ignore it).
|
||||||
]]
|
]]
|
||||||
}
|
get {
|
||||||
@property focus_region_show_mode {
|
legacy: elm_widget_focus_region_show_mode_get;
|
||||||
[[Control the focus_region_show mode.]]
|
}
|
||||||
|
set {
|
||||||
|
legacy: elm_widget_focus_region_show_mode_set;
|
||||||
|
}
|
||||||
values {
|
values {
|
||||||
/* FIXME: This enum is in Elm namespace! */
|
mode: Efl.Ui.Interest_Region_Mode;
|
||||||
mode: Elm.Focus.Region.Show_Mode; [[Focus region show mode]]
|
[[Whether to show a specific item or the widget as a whole.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Focus highlight (visual focus rectangle) properties */
|
||||||
@property focus_highlight_geometry @protected {
|
@property focus_highlight_geometry @protected {
|
||||||
[[The rectangle region to be highlighted on focus.
|
[[The rectangle region to be highlighted on focus.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue