2018-05-02 05:10:16 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2019-03-07 07:39:06 -08:00
|
|
|
#include <Efl_Ui.h>
|
2018-05-02 05:10:16 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
|
|
|
|
#define TAB_LABEL_COUNT 15
|
|
|
|
#define TAB_ICON_COUNT 9
|
|
|
|
|
|
|
|
typedef struct _App_Data {
|
|
|
|
Evas_Object *navi;
|
|
|
|
Eo *tab_pager;
|
|
|
|
} App_Data;
|
|
|
|
|
|
|
|
typedef struct _Tab_Set_Data {
|
|
|
|
Eo *tab_pager;
|
|
|
|
Eo *spinner;
|
|
|
|
} Tab_Set_Data;
|
|
|
|
|
|
|
|
typedef struct _Tab_Change_Data {
|
|
|
|
Eo *tab_pager;
|
|
|
|
Eo *label_check;
|
|
|
|
Eo *icon_check;
|
|
|
|
} Tab_Change_Data;
|
|
|
|
|
2018-10-10 02:05:18 -07:00
|
|
|
static int tab_label_count;
|
|
|
|
static int tab_icon_count;
|
|
|
|
|
2018-05-02 05:10:16 -07:00
|
|
|
static void _current_cb(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _pack_cb(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _unpack_cb(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _tab_cb(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _transition_cb(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _win_del_cb(void *data, const Efl_Event *ev);
|
|
|
|
|
|
|
|
static char *tab_labels[] = {
|
|
|
|
"efl", "elementary", "ecore", "evas", "eina",
|
|
|
|
"eo", "eolian", "embryo", "ethumb", "evil",
|
|
|
|
"eet", "edje", "ector", "efreet", "eldbus"
|
|
|
|
};
|
|
|
|
|
|
|
|
static char *tab_icons[] = {
|
|
|
|
"document-print", "folder-new", "object-rotate-right",
|
|
|
|
"mail-send", "edit-cut", "edit-copy",
|
|
|
|
"edit-paste", "edit-delete", "clock"
|
|
|
|
};
|
|
|
|
|
|
|
|
static char *tab_label_get()
|
|
|
|
{
|
2018-10-10 02:05:18 -07:00
|
|
|
if (tab_label_count == TAB_LABEL_COUNT) tab_label_count = 0;
|
|
|
|
return tab_labels[tab_label_count++];
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *tab_icon_get()
|
|
|
|
{
|
2018-10-10 02:05:18 -07:00
|
|
|
if (tab_icon_count == TAB_ICON_COUNT) tab_icon_count = 0;
|
|
|
|
return tab_icons[tab_icon_count++];
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
Eo *
|
|
|
|
content_add(Eo *parent, char *text)
|
|
|
|
{
|
|
|
|
Eo *page;
|
|
|
|
char buf[PATH_MAX];
|
2018-11-16 01:45:05 -08:00
|
|
|
page = efl_add(EFL_UI_LAYOUT_CLASS, parent);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%s/objects/test_tab_pager.edj", elm_app_data_dir_get());
|
|
|
|
|
2018-11-16 01:45:05 -08:00
|
|
|
page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
|
2019-02-27 10:17:09 -08:00
|
|
|
efl_file_set(efl_added, buf),
|
|
|
|
efl_file_key_set(efl_added, "page_layout"),
|
2019-03-25 22:20:27 -07:00
|
|
|
efl_file_load(efl_added),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_text_set(efl_part(efl_added, "text"), text),
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
|
|
|
|
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE));
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
|
|
|
Eo *
|
|
|
|
tab_page_add(Eo *parent)
|
|
|
|
{
|
|
|
|
Eo *tab_page;
|
|
|
|
char *label = tab_label_get();
|
|
|
|
char *icon = tab_icon_get();
|
|
|
|
Eo *content = content_add(parent, label);
|
|
|
|
|
|
|
|
tab_page = efl_add(EFL_UI_TAB_PAGE_CLASS, parent);
|
|
|
|
efl_content_set(tab_page, content);
|
2019-08-23 08:33:50 -07:00
|
|
|
Eo *item = efl_ui_tab_page_tab_bar_item_get(tab_page);
|
|
|
|
efl_text_set(item, label);
|
|
|
|
efl_ui_tab_bar_default_item_icon_set(item, icon);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
return tab_page;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
2019-08-23 10:16:56 -07:00
|
|
|
Eo *win, *layout, *navi, *list, *tp, *page;
|
2018-05-02 05:10:16 -07:00
|
|
|
//Efl_Page_Transition *tran;
|
|
|
|
App_Data *ad = NULL;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
2019-09-20 05:57:09 -07:00
|
|
|
efl_text_set(efl_added, "Efl.Ui.Tab_Pager"),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
|
|
|
|
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _win_del_cb, ad));
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%s/objects/test_tab_pager.edj", elm_app_data_dir_get());
|
2018-11-16 01:45:05 -08:00
|
|
|
layout = efl_add(EFL_UI_LAYOUT_CLASS, win,
|
2019-02-27 10:17:09 -08:00
|
|
|
efl_file_set(efl_added, buf),
|
|
|
|
efl_file_key_set(efl_added, "tab_page_layout"),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_content_set(win, efl_added));
|
|
|
|
|
|
|
|
navi = elm_naviframe_add(layout);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(navi, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_align_set(navi, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_content_set(efl_part(layout, "menu"), navi);
|
|
|
|
|
|
|
|
list = elm_list_add(navi);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2018-05-02 05:10:16 -07:00
|
|
|
elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
|
|
|
|
elm_naviframe_item_push(navi, "Properties", NULL, NULL, list, NULL);
|
|
|
|
efl_gfx_entity_visible_set(list, EINA_TRUE);
|
|
|
|
|
|
|
|
tp = efl_add(EFL_UI_TAB_PAGER_CLASS, layout,
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
|
|
|
|
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_content_set(efl_part(layout, "tab_pager"), efl_added));
|
|
|
|
|
2018-10-10 02:05:18 -07:00
|
|
|
tab_label_count = 0;
|
|
|
|
tab_icon_count = 0;
|
|
|
|
|
2018-05-02 05:10:16 -07:00
|
|
|
for (i = 0 ; i < 3 ; i ++)
|
|
|
|
{
|
|
|
|
page = tab_page_add(tp);
|
|
|
|
efl_pack_end(tp, page);
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
if (i == 0)
|
|
|
|
efl_ui_spotlight_active_element_set(tp, page);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
2018-09-19 00:40:51 -07:00
|
|
|
ad = (App_Data*)calloc(1, sizeof(App_Data));
|
2018-05-02 05:10:16 -07:00
|
|
|
ad->navi = navi;
|
|
|
|
ad->tab_pager = tp;
|
|
|
|
|
|
|
|
elm_list_item_append(list, "Current", NULL, NULL, _current_cb, ad);
|
|
|
|
elm_list_item_append(list, "Pack", NULL, NULL, _pack_cb, ad);
|
|
|
|
elm_list_item_append(list, "Unpack", NULL, NULL, _unpack_cb, ad);
|
|
|
|
elm_list_item_append(list, "Tab", NULL, NULL, _tab_cb, ad);
|
|
|
|
elm_list_item_append(list, "Transition", NULL, NULL, _transition_cb, ad);
|
|
|
|
elm_list_go(list);
|
|
|
|
|
|
|
|
efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 300));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Menu Callback */
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
elm_naviframe_item_pop(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_tab_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Tab_Set_Data *tsd = data;
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
efl_ui_spotlight_active_element_set(tsd->tab_pager, efl_pack_content_get(tsd->tab_pager, elm_spinner_value_get(tsd->spinner)));
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_tab_set_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
App_Data *ad = (App_Data *) data;
|
|
|
|
Evas_Object *navi = ad->navi;
|
|
|
|
Eo *tab_pager = ad->tab_pager;
|
|
|
|
Eo *btn, *box, *sp;
|
|
|
|
Tab_Set_Data *tsd = calloc(1, sizeof(Tab_Set_Data));
|
|
|
|
|
|
|
|
Elm_List_Item *it = event_info;
|
|
|
|
elm_list_item_selected_set(it, EINA_FALSE);
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
|
|
|
|
efl_text_set(efl_added, "Back"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi));
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
box = efl_add(EFL_UI_BOX_CLASS, navi,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2018-05-02 05:10:16 -07:00
|
|
|
elm_naviframe_item_push(navi, "Current", btn, NULL, efl_added, NULL));
|
|
|
|
|
|
|
|
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
|
2019-06-19 00:55:51 -07:00
|
|
|
efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1),
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
tsd->tab_pager = tab_pager;
|
|
|
|
tsd->spinner = sp;
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Current Tab Page Set"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tab_set_btn_cb, tsd),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _tab_set_btn_del_cb, tsd),
|
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_begin_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
|
|
|
Eo *tab_page;
|
|
|
|
|
|
|
|
tab_page = tab_page_add(tab_pager);
|
|
|
|
|
|
|
|
efl_pack_begin(tab_pager, tab_page);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_end_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
|
|
|
Eo *tab_page;
|
|
|
|
|
|
|
|
tab_page = tab_page_add(tab_pager);
|
|
|
|
|
|
|
|
efl_pack_end(tab_pager, tab_page);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_before_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
|
|
|
Eo *tab_page, *cur_tab_page;
|
|
|
|
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
cur_tab_page = efl_ui_spotlight_active_element_get(tab_pager);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
tab_page = tab_page_add(tab_pager);
|
|
|
|
|
|
|
|
efl_pack_before(tab_pager, tab_page, cur_tab_page);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_after_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
|
|
|
Eo *tab_page, *cur_tab_page;
|
|
|
|
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
cur_tab_page = efl_ui_spotlight_active_element_get(tab_pager);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
tab_page = tab_page_add(tab_pager);
|
|
|
|
|
|
|
|
efl_pack_after(tab_pager, tab_page, cur_tab_page);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_at_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Tab_Set_Data *tsd = data;
|
|
|
|
Eo *tab_page;
|
|
|
|
|
|
|
|
tab_page = tab_page_add(tsd->tab_pager);
|
|
|
|
|
|
|
|
efl_pack_at(tsd->tab_pager, tab_page, elm_spinner_value_get(tsd->spinner));
|
2019-06-19 00:55:51 -07:00
|
|
|
efl_ui_range_limits_set(tsd->spinner, 0, efl_content_count(tsd->tab_pager) - 1);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_at_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
App_Data *ad = (App_Data *) data;
|
|
|
|
Evas_Object *navi = ad->navi;
|
|
|
|
Eo *tab_pager = ad->tab_pager;
|
|
|
|
Eo *btn, *box, *in_box, *sp;
|
|
|
|
Tab_Set_Data *tsd = calloc(1, sizeof(Tab_Set_Data));
|
|
|
|
|
|
|
|
Elm_List_Item *it = event_info;
|
|
|
|
elm_list_item_selected_set(it, EINA_FALSE);
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
|
|
|
|
efl_text_set(efl_added, "Back"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi));
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
box = efl_add(EFL_UI_BOX_CLASS, navi,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2018-05-02 05:10:16 -07:00
|
|
|
elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL));
|
|
|
|
|
|
|
|
/* Pack Begin */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Pack Begin"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_begin_btn_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
/* Pack End */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Pack End"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_end_btn_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
/* Pack Before */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Pack Before Current Tab Page"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_before_btn_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
/* Pack After */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Pack After Current Tab Page"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_after_btn_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
in_box = efl_add(EFL_UI_BOX_CLASS, box,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box,
|
2019-06-19 00:55:51 -07:00
|
|
|
efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1),
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(in_box, efl_added));
|
|
|
|
|
|
|
|
tsd->tab_pager = tab_pager;
|
|
|
|
tsd->spinner = sp;
|
|
|
|
|
|
|
|
/* Pack At */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, in_box,
|
|
|
|
efl_text_set(efl_added, "Pack At"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_at_btn_cb, tsd),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _pack_at_btn_del_cb, tsd),
|
|
|
|
efl_pack_end(in_box, efl_added));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_clear_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
|
|
|
efl_pack_clear(tab_pager);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_unpack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
|
|
|
|
Eo *tab_page = efl_ui_spotlight_active_element_get(tab_pager);
|
|
|
|
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_unpack(tab_pager, tab_page);
|
2019-03-25 22:20:27 -07:00
|
|
|
efl_del(tab_page);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_unpack_all_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *tab_pager = data;
|
|
|
|
efl_pack_unpack_all(tab_pager);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_unpack_at_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Tab_Set_Data *tsd = data;
|
|
|
|
|
|
|
|
efl_pack_unpack_at(tsd->tab_pager, elm_spinner_value_get(tsd->spinner));
|
2019-06-19 00:55:51 -07:00
|
|
|
efl_ui_range_limits_set(tsd->spinner, 0, efl_content_count(tsd->tab_pager) - 1);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_unpack_at_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
App_Data *ad = (App_Data *) data;
|
|
|
|
Evas_Object *navi = ad->navi;
|
|
|
|
Eo *tab_pager = ad->tab_pager;
|
|
|
|
Eo *btn, *box, *sp, *in_box;
|
|
|
|
Tab_Set_Data *tsd = calloc(1, sizeof(Tab_Set_Data));
|
|
|
|
|
|
|
|
Elm_List_Item *it = event_info;
|
|
|
|
elm_list_item_selected_set(it, EINA_FALSE);
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
|
|
|
|
efl_text_set(efl_added, "Back"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi));
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
box = efl_add(EFL_UI_BOX_CLASS, navi,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2018-05-02 05:10:16 -07:00
|
|
|
elm_naviframe_item_push(navi, "Unpack", btn, NULL, efl_added, NULL));
|
|
|
|
|
|
|
|
/* Clear */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Clear"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _clear_btn_cb, tab_pager),
|
2019-03-25 22:20:27 -07:00
|
|
|
efl_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
/* Unpack */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Unpack"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _unpack_btn_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
/* Unpack All */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Unpack All"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _unpack_all_btn_cb, tab_pager),
|
2019-03-25 22:20:27 -07:00
|
|
|
efl_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
in_box = efl_add(EFL_UI_BOX_CLASS, box,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box,
|
2019-06-19 00:55:51 -07:00
|
|
|
efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1),
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(in_box, efl_added));
|
|
|
|
|
|
|
|
tsd->tab_pager = tab_pager;
|
|
|
|
tsd->spinner = sp;
|
|
|
|
|
|
|
|
/* Unpack At */
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, in_box,
|
|
|
|
efl_text_set(efl_added, "Unpack At"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _unpack_at_btn_cb, tsd),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _unpack_at_btn_del_cb, tsd),
|
2019-03-25 22:20:27 -07:00
|
|
|
efl_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(in_box, efl_added));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_change_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Tab_Change_Data *tcd = data;
|
|
|
|
|
|
|
|
Eo *tab_page, *content;
|
|
|
|
char *label = NULL;
|
|
|
|
char *icon = NULL;
|
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
|
|
|
|
|
|
|
tab_page = efl_ui_spotlight_active_element_get(tcd->tab_pager);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
2019-08-05 10:42:02 -07:00
|
|
|
if (efl_ui_selectable_selected_get(tcd->label_check))
|
2018-05-02 05:10:16 -07:00
|
|
|
{
|
|
|
|
label = tab_label_get();
|
2019-08-23 08:33:50 -07:00
|
|
|
efl_text_set(efl_ui_tab_page_tab_bar_item_get(tab_page), label);
|
2018-05-02 05:10:16 -07:00
|
|
|
content = content_add(tab_page, label);
|
|
|
|
efl_content_set(tab_page, content);
|
|
|
|
}
|
|
|
|
|
2019-08-05 10:42:02 -07:00
|
|
|
if (efl_ui_selectable_selected_get(tcd->icon_check))
|
2018-05-02 05:10:16 -07:00
|
|
|
{
|
|
|
|
icon = tab_icon_get();
|
2019-08-23 08:33:50 -07:00
|
|
|
efl_ui_tab_bar_default_item_icon_set(efl_ui_tab_page_tab_bar_item_get(tab_page), icon);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_change_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
App_Data *ad = (App_Data *) data;
|
|
|
|
Evas_Object *navi = ad->navi;
|
|
|
|
Eo *tab_pager = ad->tab_pager;
|
|
|
|
Eo *btn, *box, *label_check, *icon_check;
|
|
|
|
Tab_Change_Data *tcd = calloc(1, sizeof(Tab_Change_Data));
|
|
|
|
|
|
|
|
Elm_List_Item *it = event_info;
|
|
|
|
elm_list_item_selected_set(it, EINA_FALSE);
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
|
|
|
|
efl_text_set(efl_added, "Back"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi));
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
box = efl_add(EFL_UI_BOX_CLASS, navi,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2018-05-02 05:10:16 -07:00
|
|
|
elm_naviframe_item_push(navi, "Tab", btn, NULL, efl_added, NULL));
|
|
|
|
|
2019-05-29 11:06:25 -07:00
|
|
|
label_check = efl_add(EFL_UI_CHECK_CLASS, box);
|
|
|
|
efl_text_set(label_check, "Tab Label + Page");
|
2019-08-05 10:42:02 -07:00
|
|
|
efl_ui_selectable_selected_set(label_check, EINA_FALSE);
|
2019-05-29 11:06:25 -07:00
|
|
|
efl_pack_end(box, label_check);
|
|
|
|
|
|
|
|
icon_check = efl_add(EFL_UI_CHECK_CLASS, box);
|
|
|
|
efl_text_set(icon_check, "Tab Icon");
|
2019-08-05 10:42:02 -07:00
|
|
|
efl_ui_selectable_selected_set(icon_check, EINA_FALSE);
|
2019-05-29 11:06:25 -07:00
|
|
|
efl_pack_end(box, icon_check);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
tcd->tab_pager = tab_pager;
|
|
|
|
tcd->label_check = label_check;
|
|
|
|
tcd->icon_check = icon_check;
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Change"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _change_btn_cb, tcd),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _change_btn_del_cb, tcd),
|
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-05-16 10:13:30 -07:00
|
|
|
_tran_set_btn_scroll_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
2018-05-02 05:10:16 -07:00
|
|
|
{
|
2019-07-04 16:02:43 -07:00
|
|
|
Efl_Ui_Spotlight_Manager_Scroll *scroll = efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS);
|
|
|
|
efl_ui_spotlight_manager_set(data, scroll);
|
2019-05-16 10:13:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_tran_set_btn_stack_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
2019-07-04 16:02:43 -07:00
|
|
|
Efl_Ui_Spotlight_Manager_Scroll *stack = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS);
|
|
|
|
efl_ui_spotlight_manager_set(data, stack);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_tran_unset_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
2019-07-04 16:02:43 -07:00
|
|
|
efl_ui_spotlight_manager_set(data, NULL);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_transition_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|
|
|
{
|
|
|
|
App_Data *ad = (App_Data *) data;
|
|
|
|
Evas_Object *navi = ad->navi;
|
|
|
|
Eo *tab_pager = ad->tab_pager;
|
|
|
|
Eo *btn, *box;
|
|
|
|
|
|
|
|
Elm_List_Item *it = event_info;
|
|
|
|
elm_list_item_selected_set(it, EINA_FALSE);
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
|
|
|
|
efl_text_set(efl_added, "Back"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi));
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
box = efl_add(EFL_UI_BOX_CLASS, navi,
|
2019-10-02 03:04:12 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10),
|
2018-05-02 05:10:16 -07:00
|
|
|
elm_naviframe_item_push(navi, "Transition", btn, NULL, efl_added, NULL));
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
2019-05-16 10:13:30 -07:00
|
|
|
efl_text_set(efl_added, "Scroll"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tran_set_btn_scroll_cb, tab_pager),
|
2019-05-16 10:13:30 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Stack"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tran_set_btn_stack_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
|
|
|
|
efl_text_set(efl_added, "Unset"),
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tran_unset_btn_cb, tab_pager),
|
2018-05-02 05:10:16 -07:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
}
|