forked from enlightenment/enlightenment
Luncher: Add config options to function only as a launcher, only as a taskbar, or as both.
This commit is contained in:
parent
fa0d585aa5
commit
2ef2c37062
|
@ -239,12 +239,12 @@ _bar_instance_watch(void *data, E_Exec_Instance *ex, E_Exec_Watch_Type type)
|
|||
case E_EXEC_WATCH_STARTED:
|
||||
if (ic->starting) elm_layout_signal_emit(ic->o_layout, "e,state,started", "e");
|
||||
ic->starting = EINA_FALSE;
|
||||
if (!ic->execs)
|
||||
if (!ic->execs && ic->inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
snprintf(ori, sizeof(ori), "e,state,on,%s", _bar_location_get(ic->inst));
|
||||
elm_layout_signal_emit(ic->o_layout, ori, "e");
|
||||
}
|
||||
if (!eina_list_data_find(ic->execs, ex))
|
||||
if (!eina_list_data_find(ic->execs, ex) && ic->inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
ic->execs = eina_list_append(ic->execs, ex);
|
||||
break;
|
||||
case E_EXEC_WATCH_TIMEOUT:
|
||||
|
@ -1057,40 +1057,6 @@ _bar_icon_file_set(Icon *ic, Efreet_Desktop *desktop, E_Client *non_desktop_clie
|
|||
elm_image_file_set(ic->o_overlay, path, k);
|
||||
}
|
||||
|
||||
static void
|
||||
_bar_icon_resized(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
//This code is supposed to adjust aspect correctly when there is an effect happening. Uncomment to test.
|
||||
/*Instance *inst = data;
|
||||
Icon *ic = NULL;
|
||||
Eina_List *l = NULL;
|
||||
Evas_Coord aspect = 0, large = 0, w, h;
|
||||
|
||||
if (!inst->effect) return;
|
||||
switch (e_gadget_site_orient_get(e_gadget_site_get(inst->o_main)))
|
||||
{
|
||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||
EINA_LIST_FOREACH(inst->icons, l, ic)
|
||||
{
|
||||
evas_object_geometry_get(ic->o_icon, 0, 0, &w, &h);
|
||||
if (w > large)
|
||||
large = w;
|
||||
aspect += h;
|
||||
}
|
||||
evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, large, aspect);
|
||||
break;
|
||||
default:
|
||||
EINA_LIST_FOREACH(inst->icons, l, ic)
|
||||
{
|
||||
evas_object_geometry_get(ic->o_icon, 0, 0, &w, &h);
|
||||
if (h > large)
|
||||
large = h;
|
||||
aspect += w;
|
||||
}
|
||||
evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, aspect, large);
|
||||
}*/
|
||||
}
|
||||
|
||||
static Icon *
|
||||
_bar_icon_add(Instance *inst, Efreet_Desktop *desktop, E_Client *non_desktop_client)
|
||||
{
|
||||
|
@ -1119,7 +1085,7 @@ _bar_icon_add(Instance *inst, Efreet_Desktop *desktop, E_Client *non_desktop_cli
|
|||
"e/gadget/luncher/icon");
|
||||
E_EXPAND(ic->o_layout);
|
||||
E_FILL(ic->o_layout);
|
||||
edje_object_signal_callback_add(elm_layout_edje_get(ic->o_layout), "e,state,resized", "e", _bar_icon_resized, inst);
|
||||
// edje_object_signal_callback_add(elm_layout_edje_get(ic->o_layout), "e,state,resized", "e", _bar_icon_resized, inst);
|
||||
elm_box_pack_end(inst->o_icon_con, ic->o_layout);
|
||||
evas_object_show(ic->o_layout);
|
||||
|
||||
|
@ -1179,12 +1145,15 @@ _bar_icon_add(Instance *inst, Efreet_Desktop *desktop, E_Client *non_desktop_cli
|
|||
|
||||
if (desktop)
|
||||
{
|
||||
l = e_exec_desktop_instances_find(desktop);
|
||||
if (l)
|
||||
if (inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
snprintf(ori, sizeof(ori), "e,state,on,%s", _bar_location_get(inst));
|
||||
elm_layout_signal_emit(ic->o_layout, ori, "e");
|
||||
ic->execs = eina_list_clone(l);
|
||||
l = e_exec_desktop_instances_find(desktop);
|
||||
if (l)
|
||||
{
|
||||
snprintf(ori, sizeof(ori), "e,state,on,%s", _bar_location_get(inst));
|
||||
elm_layout_signal_emit(ic->o_layout, ori, "e");
|
||||
ic->execs = eina_list_clone(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1497,7 +1466,7 @@ _bar_fill(Instance *inst)
|
|||
Icon *ic;
|
||||
char ori[32];
|
||||
|
||||
if (inst->order)
|
||||
if (inst->order && inst->cfg->type != E_LUNCHER_MODULE_TASKS_ONLY)
|
||||
{
|
||||
Efreet_Desktop *desktop;
|
||||
Eina_List *list;
|
||||
|
@ -1509,6 +1478,11 @@ _bar_fill(Instance *inst)
|
|||
inst->icons = eina_list_append(inst->icons, ic);
|
||||
}
|
||||
}
|
||||
if (inst->cfg->type == E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
_bar_aspect(inst);
|
||||
return;
|
||||
}
|
||||
it = eina_hash_iterator_data_new(execs);
|
||||
EINA_ITERATOR_FOREACH(it, l)
|
||||
{
|
||||
|
@ -1796,11 +1770,17 @@ _bar_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
|
|||
{
|
||||
Instance *inst = data;
|
||||
char buf[4096];
|
||||
Ecore_Event_Handler *handler;
|
||||
|
||||
if (inst->o_main != event_data) return;
|
||||
if (e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s", inst->cfg->dir) >= sizeof(buf))
|
||||
return;
|
||||
|
||||
EINA_LIST_FREE(handlers, handler)
|
||||
E_FREE_FUNC(handler, ecore_event_handler_del);
|
||||
|
||||
E_FREE_FUNC(inst->iconify_provider, e_comp_object_effect_mover_del);
|
||||
|
||||
luncher_config->items = eina_list_remove(luncher_config->items, inst->cfg);
|
||||
eina_stringshare_del(inst->cfg->style);
|
||||
eina_stringshare_del(inst->cfg->dir);
|
||||
|
@ -1909,19 +1889,23 @@ _bar_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
|
|||
inst->order = e_order_new(buf);
|
||||
e_order_update_callback_set(inst->order, _bar_order_update, inst);
|
||||
|
||||
inst->iconify_provider = e_comp_object_effect_mover_add(80, "e,action,*iconify",
|
||||
_bar_iconify_start, inst);
|
||||
|
||||
if (inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
inst->iconify_provider = e_comp_object_effect_mover_add(80, "e,action,*iconify",
|
||||
_bar_iconify_start, inst);
|
||||
}
|
||||
_bar_fill(inst);
|
||||
|
||||
inst->drop_handler =
|
||||
e_gadget_drop_handler_add(inst->o_main, inst,
|
||||
_bar_drop_enter, _bar_drop_move,
|
||||
_bar_drop_leave, _bar_drop_drop,
|
||||
drop, 3);
|
||||
elm_layout_content_set(inst->o_main, "e.swallow.drop", inst->drop_handler);
|
||||
evas_object_show(inst->drop_handler);
|
||||
|
||||
if (inst->cfg->type != E_LUNCHER_MODULE_TASKS_ONLY)
|
||||
{
|
||||
inst->drop_handler =
|
||||
e_gadget_drop_handler_add(inst->o_main, inst,
|
||||
_bar_drop_enter, _bar_drop_move,
|
||||
_bar_drop_leave, _bar_drop_drop,
|
||||
drop, 3);
|
||||
elm_layout_content_set(inst->o_main, "e.swallow.drop", inst->drop_handler);
|
||||
evas_object_show(inst->drop_handler);
|
||||
}
|
||||
evas_object_event_callback_add(inst->o_main, EVAS_CALLBACK_RESIZE, _bar_resize, inst);
|
||||
}
|
||||
|
||||
|
@ -1945,6 +1929,7 @@ _conf_item_get(int *id)
|
|||
ci->id = -1;
|
||||
ci->dir = eina_stringshare_add("default");
|
||||
ci->style = eina_stringshare_add("default");
|
||||
ci->type = E_LUNCHER_MODULE_FULL;
|
||||
luncher_config->items = eina_list_append(luncher_config->items, ci);
|
||||
|
||||
return ci;
|
||||
|
@ -1996,6 +1981,61 @@ bar_reorder(Instance *inst)
|
|||
}
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
bar_config_updated(Instance *inst)
|
||||
{
|
||||
Ecore_Event_Handler *handler;
|
||||
const char *drop[] = { "enlightenment/desktop", "enlightenment/border", "text/uri-list" };
|
||||
|
||||
EINA_LIST_FREE(handlers, handler)
|
||||
E_FREE_FUNC(handler, ecore_event_handler_del);
|
||||
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CONFIG_ICON_THEME,
|
||||
_bar_cb_update_icons, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_ICON_CACHE_UPDATE,
|
||||
_bar_cb_update_icons, NULL);
|
||||
if (inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_NEW,
|
||||
_bar_cb_exec_new, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_NEW_CLIENT,
|
||||
_bar_cb_exec_new, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_PROPERTY,
|
||||
_bar_cb_exec_client_prop, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_DEL,
|
||||
_bar_cb_exec_del, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE,
|
||||
_bar_cb_client_remove, NULL);
|
||||
}
|
||||
|
||||
if (!inst->iconify_provider && inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
inst->iconify_provider = e_comp_object_effect_mover_add(80, "e,action,*iconify",
|
||||
_bar_iconify_start, inst);
|
||||
}
|
||||
else if (inst->iconify_provider && inst->cfg->type == E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
E_FREE_FUNC(inst->iconify_provider, e_comp_object_effect_mover_del);
|
||||
}
|
||||
|
||||
bar_reorder(inst);
|
||||
|
||||
if (!inst->drop_handler && inst->cfg->type != E_LUNCHER_MODULE_TASKS_ONLY)
|
||||
{
|
||||
inst->drop_handler =
|
||||
e_gadget_drop_handler_add(inst->o_main, inst,
|
||||
_bar_drop_enter, _bar_drop_move,
|
||||
_bar_drop_leave, _bar_drop_drop,
|
||||
drop, 3);
|
||||
elm_layout_content_set(inst->o_main, "e.swallow.drop", inst->drop_handler);
|
||||
evas_object_show(inst->drop_handler);
|
||||
}
|
||||
else if (inst->drop_handler && inst->cfg->type == E_LUNCHER_MODULE_TASKS_ONLY)
|
||||
{
|
||||
E_FREE_FUNC(inst->drop_handler, evas_object_del);
|
||||
}
|
||||
}
|
||||
|
||||
EINTERN Evas_Object *
|
||||
bar_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNUSED)
|
||||
{
|
||||
|
@ -2026,17 +2066,19 @@ bar_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNUSED
|
|||
_bar_cb_update_icons, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_ICON_CACHE_UPDATE,
|
||||
_bar_cb_update_icons, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_NEW,
|
||||
_bar_cb_exec_new, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_NEW_CLIENT,
|
||||
_bar_cb_exec_new, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_PROPERTY,
|
||||
_bar_cb_exec_client_prop, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_DEL,
|
||||
_bar_cb_exec_del, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE,
|
||||
_bar_cb_client_remove, NULL);
|
||||
|
||||
if (inst->cfg->type != E_LUNCHER_MODULE_LAUNCH_ONLY)
|
||||
{
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_NEW,
|
||||
_bar_cb_exec_new, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_NEW_CLIENT,
|
||||
_bar_cb_exec_new, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_PROPERTY,
|
||||
_bar_cb_exec_client_prop, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_EXEC_DEL,
|
||||
_bar_cb_exec_del, NULL);
|
||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE,
|
||||
_bar_cb_client_remove, NULL);
|
||||
}
|
||||
if (inst->cfg->id < 0) return inst->o_main;
|
||||
luncher_instances = eina_list_append(luncher_instances, inst);
|
||||
|
||||
|
|
|
@ -10,6 +10,55 @@ _config_close(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA
|
|||
e_config_save_queue();
|
||||
}
|
||||
|
||||
static void
|
||||
_config_show_general(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
evas_object_hide(luncher_config->contents);
|
||||
evas_object_hide(luncher_config->style);
|
||||
evas_object_show(luncher_config->general);
|
||||
}
|
||||
|
||||
static void
|
||||
_config_show_contents(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
evas_object_hide(luncher_config->general);
|
||||
evas_object_hide(luncher_config->style);
|
||||
evas_object_show(luncher_config->contents);
|
||||
}
|
||||
|
||||
static void
|
||||
_config_show_style(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
evas_object_hide(luncher_config->general);
|
||||
evas_object_hide(luncher_config->contents);
|
||||
evas_object_show(luncher_config->style);
|
||||
}
|
||||
|
||||
static void
|
||||
_type_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
int value = elm_radio_value_get(obj);
|
||||
|
||||
switch (value)
|
||||
{
|
||||
case 0:
|
||||
inst->cfg->type = E_LUNCHER_MODULE_FULL;
|
||||
break;
|
||||
case 1:
|
||||
inst->cfg->type = E_LUNCHER_MODULE_LAUNCH_ONLY;
|
||||
break;
|
||||
case 2:
|
||||
inst->cfg->type = E_LUNCHER_MODULE_TASKS_ONLY;
|
||||
break;
|
||||
default:
|
||||
inst->cfg->type = E_LUNCHER_MODULE_FULL;
|
||||
}
|
||||
|
||||
e_config_save_queue();
|
||||
bar_config_updated(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_config_style_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -269,8 +318,9 @@ _icon_theme_file_set(Evas_Object *img, const char *icon)
|
|||
EINTERN Evas_Object *
|
||||
config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
||||
{
|
||||
Evas_Object *popup, *tb, *lbl, *fr, *box, *list;
|
||||
Evas_Object *butbox, *sep, *hbox, *img, *but;
|
||||
Evas_Object *popup, *tb, *lbl, *fr, *box, *list, *mlist;
|
||||
Evas_Object *butbox, *sep, *hbox, *img, *but, *o, *group;
|
||||
Elm_Object_Item *it;
|
||||
|
||||
luncher_config->bar = bar;
|
||||
|
||||
|
@ -291,21 +341,98 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
|||
elm_object_style_set(lbl, "marker");
|
||||
evas_object_show(lbl);
|
||||
elm_object_text_set(lbl, _("Luncher Configuration"));
|
||||
elm_table_pack(tb, lbl, 0, 0, 1, 1);
|
||||
elm_table_pack(tb, lbl, 0, 0, 2, 1);
|
||||
|
||||
box = elm_box_add(tb);
|
||||
mlist = elm_list_add(tb);
|
||||
E_ALIGN(mlist, 0, EVAS_HINT_FILL);
|
||||
E_WEIGHT(mlist, 0, EVAS_HINT_EXPAND);
|
||||
elm_table_pack(tb, mlist, 0, 1, 1, 1);
|
||||
elm_list_select_mode_set(mlist, ELM_OBJECT_SELECT_MODE_ALWAYS);
|
||||
elm_scroller_content_min_limit(mlist, 1, 1);
|
||||
it = elm_list_item_append(mlist, _("General"), NULL, NULL,
|
||||
_config_show_general, inst);
|
||||
elm_list_item_selected_set(it, 1);
|
||||
it = elm_list_item_append(mlist, _("Contents"), NULL, NULL,
|
||||
_config_show_contents, inst);
|
||||
it = elm_list_item_append(mlist, _("Style"), NULL, NULL,
|
||||
_config_show_style, inst);
|
||||
elm_list_go(mlist);
|
||||
evas_object_show(mlist);
|
||||
|
||||
fr = elm_frame_add(tb);
|
||||
elm_object_text_set(fr, _("General"));
|
||||
E_EXPAND(fr);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_table_pack(tb, fr, 1, 1, 1, 1);
|
||||
evas_object_show(fr);
|
||||
luncher_config->general = fr;
|
||||
|
||||
box = elm_box_add(fr);
|
||||
elm_box_horizontal_set(box, EINA_FALSE);
|
||||
E_EXPAND(box);
|
||||
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_table_pack(tb, box, 0, 1, 1, 1);
|
||||
evas_object_show(box);
|
||||
|
||||
fr = elm_frame_add(box);
|
||||
lbl = elm_label_add(box);
|
||||
elm_object_text_set(lbl, _("Luncher Type:"));
|
||||
E_ALIGN(lbl, 0.0, 0.0);
|
||||
E_WEIGHT(lbl, EVAS_HINT_EXPAND, 0);
|
||||
elm_box_pack_end(box, lbl);
|
||||
evas_object_show(lbl);
|
||||
|
||||
o = elm_radio_add(box);
|
||||
elm_radio_state_value_set(o, 0);
|
||||
E_ALIGN(o, 0.0, 0.0);
|
||||
E_WEIGHT(o, EVAS_HINT_EXPAND, 0);
|
||||
elm_object_text_set(o, _("Launcher and Taskbar"));
|
||||
elm_box_pack_end(box, o);
|
||||
evas_object_smart_callback_add(o, "changed", _type_changed, inst);
|
||||
evas_object_show(o);
|
||||
group = o;
|
||||
|
||||
o = elm_radio_add(box);
|
||||
elm_radio_state_value_set(o, 1);
|
||||
elm_radio_group_add(o, group);
|
||||
E_ALIGN(o, 0.0, 0.0);
|
||||
E_WEIGHT(o, EVAS_HINT_EXPAND, 0);
|
||||
elm_object_text_set(o, _("Launcher Only"));
|
||||
elm_box_pack_end(box, o);
|
||||
evas_object_smart_callback_add(o, "changed", _type_changed, inst);
|
||||
evas_object_show(o);
|
||||
|
||||
o = elm_radio_add(box);
|
||||
elm_radio_state_value_set(o, 2);
|
||||
elm_radio_group_add(o, group);
|
||||
E_ALIGN(o, 0.0, 0.0);
|
||||
E_WEIGHT(o, EVAS_HINT_EXPAND, 0);
|
||||
elm_object_text_set(o, _("Taskbar Only"));
|
||||
elm_box_pack_end(box, o);
|
||||
evas_object_smart_callback_add(o, "changed", _type_changed, inst);
|
||||
evas_object_show(o);
|
||||
|
||||
switch(inst->cfg->type)
|
||||
{
|
||||
case E_LUNCHER_MODULE_FULL:
|
||||
elm_radio_value_set(group, 0);
|
||||
break;
|
||||
case E_LUNCHER_MODULE_LAUNCH_ONLY:
|
||||
elm_radio_value_set(group, 1);
|
||||
break;
|
||||
case E_LUNCHER_MODULE_TASKS_ONLY:
|
||||
elm_radio_value_set(group, 2);
|
||||
break;
|
||||
default:
|
||||
elm_radio_value_set(group, 0);
|
||||
}
|
||||
|
||||
elm_object_content_set(fr, box);
|
||||
|
||||
fr = elm_frame_add(tb);
|
||||
elm_object_text_set(fr, _("Style"));
|
||||
E_EXPAND(fr);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, fr);
|
||||
elm_table_pack(tb, fr, 1, 1, 1, 1);
|
||||
evas_object_show(fr);
|
||||
luncher_config->style = fr;
|
||||
|
||||
list = elm_list_add(fr);
|
||||
E_ALIGN(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -317,12 +444,13 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
|||
luncher_config->slist = list;
|
||||
_config_populate_style_list(list, inst);
|
||||
|
||||
fr = elm_frame_add(box);
|
||||
elm_object_text_set(fr, _("Icon Order"));
|
||||
fr = elm_frame_add(tb);
|
||||
elm_object_text_set(fr, _("Contents"));
|
||||
E_EXPAND(fr);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(box, fr);
|
||||
elm_table_pack(tb, fr, 1, 1, 1, 1);
|
||||
evas_object_show(fr);
|
||||
luncher_config->contents = fr;
|
||||
|
||||
box = elm_box_add(fr);
|
||||
elm_box_horizontal_set(box, EINA_FALSE);
|
||||
|
@ -430,6 +558,8 @@ config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
|||
|
||||
elm_object_content_set(fr, box);
|
||||
|
||||
_config_show_general(NULL, NULL, NULL);
|
||||
|
||||
popup = e_comp_object_util_add(popup, E_COMP_OBJECT_TYPE_NONE);
|
||||
evas_object_layer_set(popup, E_LAYER_POPUP);
|
||||
evas_object_resize(popup, zone->w / 4, zone->h / 3);
|
||||
|
|
|
@ -13,6 +13,14 @@ typedef struct _Config Config;
|
|||
typedef struct _Config_Item Config_Item;
|
||||
typedef struct _Instance Instance;
|
||||
typedef struct _Icon Icon;
|
||||
typedef enum _Luncher_Type Luncher_Type;
|
||||
|
||||
enum _Luncher_Type
|
||||
{
|
||||
E_LUNCHER_MODULE_FULL = 0,
|
||||
E_LUNCHER_MODULE_LAUNCH_ONLY,
|
||||
E_LUNCHER_MODULE_TASKS_ONLY
|
||||
};
|
||||
|
||||
struct _Config
|
||||
{
|
||||
|
@ -22,14 +30,19 @@ struct _Config
|
|||
Evas_Object *config_dialog;
|
||||
Evas_Object *slist;
|
||||
Evas_Object *list;
|
||||
Evas_Object *general;
|
||||
Evas_Object *contents;
|
||||
Evas_Object *style;
|
||||
Eina_Bool bar;
|
||||
};
|
||||
|
||||
struct _Config_Item
|
||||
{
|
||||
int id;
|
||||
int version;
|
||||
Eina_Stringshare *style;
|
||||
Eina_Stringshare *dir;
|
||||
Luncher_Type type;
|
||||
};
|
||||
|
||||
struct _Instance
|
||||
|
@ -87,6 +100,7 @@ EINTERN Evas_Object *config_luncher(E_Zone *zone, Instance *inst, Eina_Bool bar)
|
|||
EINTERN Evas_Object *bar_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient);
|
||||
EINTERN void bar_reorder(Instance *inst);
|
||||
EINTERN void bar_recalculate(Instance *inst);
|
||||
EINTERN void bar_config_updated(Instance *inst);
|
||||
EINTERN Evas_Object *grid_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient);
|
||||
EINTERN void grid_reorder(Instance *inst);
|
||||
EINTERN void grid_recalculate(Instance *inst);
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#include "luncher.h"
|
||||
|
||||
#define CONFIG_VERSION 2
|
||||
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
static E_Config_DD *conf_item_edd = NULL;
|
||||
Eina_List *luncher_instances = NULL;
|
||||
|
@ -8,14 +11,19 @@ Config *luncher_config = NULL;
|
|||
EINTERN void
|
||||
luncher_init(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
Config_Item *ci;
|
||||
|
||||
conf_item_edd = E_CONFIG_DD_NEW("Luncher_Config_Item", Config_Item);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Config_Item
|
||||
#define D conf_item_edd
|
||||
E_CONFIG_VAL(D, T, id, INT);
|
||||
E_CONFIG_VAL(D, T, version, INT);
|
||||
E_CONFIG_VAL(D, T, style, STR);
|
||||
E_CONFIG_VAL(D, T, dir, STR);
|
||||
E_CONFIG_VAL(D, T, type, INT);
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("Luncher_Config", Config);
|
||||
#undef T
|
||||
|
@ -28,15 +36,23 @@ luncher_init(void)
|
|||
|
||||
if (!luncher_config)
|
||||
{
|
||||
Config_Item *ci;
|
||||
|
||||
luncher_config = E_NEW(Config, 1);
|
||||
ci = E_NEW(Config_Item, 1);
|
||||
ci->id = 0;
|
||||
ci->version = CONFIG_VERSION;
|
||||
ci->style = eina_stringshare_add("default");
|
||||
ci->dir = eina_stringshare_add("default");
|
||||
ci->type = E_LUNCHER_MODULE_FULL;
|
||||
luncher_config->items = eina_list_append(luncher_config->items, ci);
|
||||
}
|
||||
EINA_LIST_FOREACH(luncher_config->items, l, ci)
|
||||
{
|
||||
if (ci->version < CONFIG_VERSION)
|
||||
{
|
||||
ci->version = CONFIG_VERSION;
|
||||
ci->type = E_LUNCHER_MODULE_FULL;
|
||||
}
|
||||
}
|
||||
e_gadget_type_add("Luncher Bar", bar_create, NULL);
|
||||
e_gadget_type_add("Luncher Grid", grid_create, NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue