forked from enlightenment/efl
efl_ui_Focus_manager_root_focus: add focus rectangle
the focus rectangle is basically just a normal efl.canvas.rectangle, but with the focus interface implemented. This fixes alot of errors which gets called when the root_focus manager is used, with the submanager as mixin.
This commit is contained in:
parent
e8039ffc2d
commit
7a86e23642
|
@ -151,6 +151,7 @@ elm_private_eolian_files = \
|
||||||
lib/elementary/efl_ui_win_part.eo \
|
lib/elementary/efl_ui_win_part.eo \
|
||||||
tests/elementary/focus_test.eo \
|
tests/elementary/focus_test.eo \
|
||||||
tests/elementary/focus_test_sub_main.eo \
|
tests/elementary/focus_test_sub_main.eo \
|
||||||
|
lib/elementary/efl_ui_focus_rectangle.eo \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
# Legacy classes - not part of public EO API
|
# Legacy classes - not part of public EO API
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
|
|
||||||
|
#include "efl_ui_focus_rectangle.eo.h"
|
||||||
|
|
||||||
#define MY_CLASS EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS
|
#define MY_CLASS EFL_UI_FOCUS_MANAGER_ROOT_FOCUS_CLASS
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -133,7 +135,11 @@ _efl_ui_focus_manager_root_focus_efl_object_finalize(Eo *obj, Efl_Ui_Focus_Manag
|
||||||
ret = efl_finalize(efl_super(obj, MY_CLASS));
|
ret = efl_finalize(efl_super(obj, MY_CLASS));
|
||||||
|
|
||||||
pd->root = efl_ui_focus_manager_root_get(obj);
|
pd->root = efl_ui_focus_manager_root_get(obj);
|
||||||
pd->rect = evas_object_rectangle_add(evas_object_evas_get(pd->root));
|
|
||||||
|
pd->rect = efl_add(EFL_UI_FOCUS_RECTANGLE_CLASS, evas_object_evas_get(pd->root));
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->rect, NULL);
|
||||||
|
|
||||||
pd->iterator_list = eina_list_append(pd->iterator_list, pd->root);
|
pd->iterator_list = eina_list_append(pd->iterator_list, pd->root);
|
||||||
|
|
||||||
_state_eval(obj, pd);
|
_state_eval(obj, pd);
|
||||||
|
@ -143,3 +149,36 @@ _efl_ui_focus_manager_root_focus_efl_object_finalize(Eo *obj, Efl_Ui_Focus_Manag
|
||||||
|
|
||||||
|
|
||||||
#include "efl_ui_focus_manager_root_focus.eo.c"
|
#include "efl_ui_focus_manager_root_focus.eo.c"
|
||||||
|
/* focus rectnangle implementation */
|
||||||
|
typedef struct {
|
||||||
|
Eina_Bool focus;
|
||||||
|
} Efl_Ui_Focus_Rectangle_Data;
|
||||||
|
|
||||||
|
EOLIAN static Eina_Rect
|
||||||
|
_efl_ui_focus_rectangle_efl_ui_focus_object_focus_geometry_get(Eo *obj, Efl_Ui_Focus_Rectangle_Data *pd EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Eina_Rect geom;
|
||||||
|
|
||||||
|
evas_object_geometry_get(obj, &geom.x, &geom.y, &geom.w, &geom.h);
|
||||||
|
|
||||||
|
return geom;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EOLIAN static void
|
||||||
|
_efl_ui_focus_rectangle_efl_ui_focus_object_focus_set(Eo *obj, Efl_Ui_Focus_Rectangle_Data *pd, Eina_Bool focus)
|
||||||
|
{
|
||||||
|
efl_ui_focus_object_focus_set(efl_super(obj, EFL_UI_FOCUS_RECTANGLE_CLASS), focus);
|
||||||
|
|
||||||
|
pd->focus = focus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EOLIAN static Eina_Bool
|
||||||
|
_efl_ui_focus_rectangle_efl_ui_focus_object_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Rectangle_Data *pd)
|
||||||
|
{
|
||||||
|
return pd->focus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "efl_ui_focus_rectangle.eo.c"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
class Efl.Ui.Focus.Rectangle (Efl.Canvas.Rectangle, Efl.Ui.Focus.Object)
|
||||||
|
{
|
||||||
|
implements {
|
||||||
|
Efl.Ui.Focus.Object.focus_geometry {get;}
|
||||||
|
Efl.Ui.Focus.Object.focus {set; get;}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue