Implement jump to pointer feature
This commit is contained in:
parent
e2869aa298
commit
07710c01fc
|
@ -566,11 +566,12 @@ _objs_expanded_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
Obj_Info *info = elm_object_item_data_get(glit), *it_data;
|
Obj_Info *info = elm_object_item_data_get(glit), *it_data;
|
||||||
EINA_LIST_FOREACH(info->children, itr, it_data)
|
EINA_LIST_FOREACH(info->children, itr, it_data)
|
||||||
{
|
{
|
||||||
Elm_Object_Item *nitem = elm_genlist_item_append(event->object, _objs_itc,
|
it_data->glitem = elm_genlist_item_append(event->object, _objs_itc,
|
||||||
it_data, glit,
|
it_data, glit,
|
||||||
it_data->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
|
it_data->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
|
||||||
_objs_sel_cb, NULL);
|
_objs_sel_cb, NULL);
|
||||||
elm_genlist_item_expanded_set(nitem, EINA_FALSE);
|
elm_genlist_item_expanded_set(it_data->glitem, EINA_FALSE);
|
||||||
|
efl_wref_add(it_data->glitem, &(it_data->glitem));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -846,6 +847,7 @@ _eoids_get(Eina_Debug_Session *session EINA_UNUSED, int src EINA_UNUSED, void *b
|
||||||
_main_widgets->objects_list, _objs_itc, info, NULL,
|
_main_widgets->objects_list, _objs_itc, info, NULL,
|
||||||
info->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
|
info->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
|
||||||
_objs_sel_cb, NULL);
|
_objs_sel_cb, NULL);
|
||||||
|
efl_wref_add(info->glitem, &(info->glitem));
|
||||||
if (info->children)
|
if (info->children)
|
||||||
elm_genlist_item_expanded_set(info->glitem, EINA_FALSE);
|
elm_genlist_item_expanded_set(info->glitem, EINA_FALSE);
|
||||||
}
|
}
|
||||||
|
@ -1005,6 +1007,45 @@ _menu_profile_selected(void *data,
|
||||||
_connection_type_change(REMOTE_CONNECTION);
|
_connection_type_change(REMOTE_CONNECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_item_realize(Obj_Info *info)
|
||||||
|
{
|
||||||
|
if (info->parent)
|
||||||
|
{
|
||||||
|
Obj_Info *pinfo = eina_hash_find(_objs_hash, &(info->parent));
|
||||||
|
if (pinfo && !pinfo->glitem) _item_realize(pinfo);
|
||||||
|
elm_genlist_item_expanded_set(pinfo->glitem, EINA_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
jump_entry_changed(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
|
{
|
||||||
|
Eo *en = event->object;
|
||||||
|
const char *ptr = elm_entry_entry_get(en);
|
||||||
|
uint64_t id = 0;
|
||||||
|
Eina_Bool err = EINA_FALSE;
|
||||||
|
printf("Ptr %s\n", ptr);
|
||||||
|
while (*ptr && !err)
|
||||||
|
{
|
||||||
|
char c = *ptr;
|
||||||
|
id <<= 4;
|
||||||
|
if (c >= '0' && c <= '9') id |= (*ptr - '0');
|
||||||
|
else if (c >= 'a' && c <= 'f') id |= (*ptr - 'a' + 0xA);
|
||||||
|
else if (c >= 'A' && c <= 'F') id |= (*ptr - 'A' + 0xA);
|
||||||
|
else err = EINA_TRUE;
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
if (!err)
|
||||||
|
{
|
||||||
|
Obj_Info *info = eina_hash_find(_objs_hash, &id);
|
||||||
|
if (!info) return;
|
||||||
|
if (!info->glitem) _item_realize(info);
|
||||||
|
elm_genlist_item_show(info->glitem, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
|
||||||
|
elm_genlist_item_selected_set(info->glitem, EINA_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
load_perform(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
load_perform(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,6 +36,8 @@ extern void
|
||||||
conn_menu_show(void *data, const Efl_Event *event);
|
conn_menu_show(void *data, const Efl_Event *event);
|
||||||
extern void
|
extern void
|
||||||
load_perform(void *data, const Efl_Event *event);
|
load_perform(void *data, const Efl_Event *event);
|
||||||
|
extern void
|
||||||
|
jump_entry_changed(void *data, const Efl_Event *event);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_config_open(void *data, const Efl_Event *event);
|
_config_open(void *data, const Efl_Event *event);
|
||||||
|
@ -126,11 +128,12 @@ gui_main_win_create(Eo *__main_parent)
|
||||||
elm_entry_single_line_set(jump_to_entry, EINA_TRUE);
|
elm_entry_single_line_set(jump_to_entry, EINA_TRUE);
|
||||||
elm_object_part_text_set(jump_to_entry, "guide", "Jump To Pointer");
|
elm_object_part_text_set(jump_to_entry, "guide", "Jump To Pointer");
|
||||||
evas_object_size_hint_align_set(jump_to_entry,
|
evas_object_size_hint_align_set(jump_to_entry,
|
||||||
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
evas_object_size_hint_weight_set(jump_to_entry,
|
evas_object_size_hint_weight_set(jump_to_entry,
|
||||||
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
elm_box_pack_end(bar_box, jump_to_entry);
|
elm_box_pack_end(bar_box, jump_to_entry);
|
||||||
evas_object_show(jump_to_entry);
|
evas_object_show(jump_to_entry);
|
||||||
|
efl_event_callback_add(jump_to_entry, ELM_ENTRY_EVENT_ACTIVATED, jump_entry_changed, NULL);
|
||||||
|
|
||||||
extensions_bt = elm_button_add(bar_box);
|
extensions_bt = elm_button_add(bar_box);
|
||||||
evas_object_size_hint_weight_set(extensions_bt, 1.000000, 1.000000);
|
evas_object_size_hint_weight_set(extensions_bt, 1.000000, 1.000000);
|
||||||
|
|
Loading…
Reference in New Issue