{NULL, NULL}
};
+static Eina_Bool _elm_multibuttonentry_smart_focus_next_enable = EINA_FALSE;
+static Eina_Bool _elm_multibuttonentry_smart_focus_direction_enable = EINA_TRUE;
+
static Eina_Bool
_entry_changed_cb(void *data, Eo *obj EINA_UNUSED,
const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
(void *)(uintptr_t)sd->shrink));
}
+ if (sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK)
+ _elm_multibuttonentry_smart_focus_direction_enable = EINA_FALSE;
+ else
+ _elm_multibuttonentry_smart_focus_direction_enable = EINA_TRUE;
+
if (sd->view_state != MULTIBUTTONENTRY_VIEW_SHRINK)
_visual_guide_text_set(obj);
}
}
}
+static void
+_on_item_focused(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Elm_Multibuttonentry_Item_Data *it = data;
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
+
+ if (!it) return;
+ sd->selected_it = it;
+}
+
static void
_on_item_unfocused(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Elm_Multibuttonentry_Item_Data *it = data;
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
if (!it) return;
+ sd->selected_it = NULL;
elm_layout_signal_emit(VIEW(it), "elm,state,unfocused", "elm");
}
//
elm_layout_signal_callback_add
(VIEW(item), "elm,deleted", "elm", _on_item_deleted, EO_OBJ(item));
+ evas_object_smart_callback_add
+ (VIEW(item), "focused", _on_item_focused, item);
evas_object_smart_callback_add
(VIEW(item), "unfocused", _on_item_unfocused, item);
evas_object_event_callback_add
elm_object_focus_set(sd->entry, EINA_TRUE);
}
}
+ else if (sd->selected_it &&
+ ((!strcmp(ev->key, "KP_Enter")) ||
+ (!strcmp(ev->key, "Return"))))
+ {
+ Elm_Multibuttonentry_Item_Data *item = sd->selected_it;
+ if (item)
+ _on_item_clicked(EO_OBJ(item), NULL, NULL, NULL);
+ }
else if (((!sd->selected_it && (sd->n_str == 0) &&
(!strcmp(ev->key, "BackSpace"))) ||
(!strcmp(ev->key, "Delete"))))
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
}
-static Eina_Bool _elm_multibuttonentry_smart_focus_next_enable = EINA_FALSE;
-
EOLIAN static Eina_Bool
_elm_multibuttonentry_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd EINA_UNUSED)
{
- return EINA_FALSE;
+ return _elm_multibuttonentry_smart_focus_direction_enable;
+}
+
+EOLIAN static Eina_Bool
+_elm_multibuttonentry_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight)
+{
+ Eina_Bool ret;
+ Eina_List *items = NULL;
+
+ items = eina_list_append(items, sd->box);
+
+ ret = elm_widget_focus_list_direction_get
+ (obj, base, items, eina_list_data_get, degree, direction, direction_item, weight);
+ eina_list_free(items);
+
+ return ret;
}
EOLIAN static Eina_Bool