elm_fileselector: move to focus compostition

Summary:
elm_fileselector was using efl_ui_widget_state_apply to call for internal chain update.
This internal chain update was relying on efl_ui_focus_object_manager_get, which
results in a wrong value at this time, since the value is still the old one and not the
current one. (This behaviour will be updated after the release). Focus composition
solves this issue by not relying on the properties of efl.ui.focus_object, but rather
take the values from the configuration in the state_apply call.

fix T6147
fix T7105

Reviewers: zmike, stefan_schmidt, segfaultxavi, devilhorns, herdsman

Reviewed By: zmike

Subscribers: herdsman, cedric, #committers

Tags: #efl

Maniphest Tasks: T7105, T6147

Differential Revision: https://phab.enlightenment.org/D6552
This commit is contained in:
Marcel Hollerbach 2018-07-12 09:33:29 -04:00 committed by Mike Blumenkrantz
parent 1de1f6d8fb
commit 92820dbb88
2 changed files with 4 additions and 14 deletions

View File

@ -13,6 +13,7 @@
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_INTERFACE_FILESELECTOR_BETA
#define EFL_PART_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#include <Elementary.h>
#include "Eio_Eo.h"
@ -104,7 +105,7 @@ _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd)
{
Eina_List *tmp = NULL;
#define A(p) tmp = eina_list_append(tmp, p);
#define A(p) if (p) tmp = eina_list_append(tmp, p);
A(pd->up_button)
A(pd->home_button)
@ -119,7 +120,7 @@ _focus_chain_update(Eo *obj, Elm_Fileselector_Data *pd)
#undef A
efl_ui_focus_manager_calc_update_order(efl_ui_focus_object_focus_manager_get(obj), obj, tmp);
efl_ui_focus_composition_elements_set(obj, tmp);
}
void
@ -2984,16 +2985,6 @@ _elm_fileselector_elm_interface_fileselector_sort_method_get(const Eo *obj EINA_
return sd->sort_type;
}
EOLIAN static Eina_Bool
_elm_fileselector_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Fileselector_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect)
{
Eina_Bool ret = efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, redirect);
_focus_chain_update(obj, pd);
return ret;
}
static Eina_Bool
_elm_fileselector_text_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const char *part, const char *label)
{

View File

@ -1,5 +1,5 @@
class Elm.Fileselector (Efl.Ui.Layout.Object, Elm.Interface.Fileselector,
Efl.Access.Widget.Action,
Efl.Access.Widget.Action, Efl.Ui.Focus.Composition,
Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary fileselector class]]
@ -37,7 +37,6 @@ class Elm.Fileselector (Efl.Ui.Layout.Object, Elm.Interface.Fileselector,
Efl.Object.constructor;
Efl.Ui.Widget.widget_event;
Efl.Ui.Widget.theme_apply;
Efl.Ui.Widget.focus_state_apply;
Elm.Interface.Fileselector.selected_models { get; }
Elm.Interface.Fileselector.selected_model { get; set; }
Elm.Interface.Fileselector.custom_filter_append;