Subject: [E-devel] [Patch][e][ibar] Add a configuration for locking icon movement


Dear all.

I added a configuration value which (un)locks icon movement in ibar module. This will be usefull if the user doesn't want to move an icon in iBar on the Shelf.
You can (un)set this value "iBar -> Settings -> Icon Movement field -> Lock Icon Move checkbox".
Please review this patch.

Thanks.
--
Doyoun Kang


SVN revision: 73910
This commit is contained in:
doyoun.kang 2012-07-16 07:31:12 +00:00 committed by Mike Blumenkrantz
parent f42c22a3aa
commit 5ac9b0d111
3 changed files with 32 additions and 13 deletions

View File

@ -5,6 +5,7 @@ struct _E_Config_Dialog_Data
{
const char *dir;
int show_label, eap_label;
int lock_move;
Evas_Object *tlist;
Evas_Object *radio_name;
@ -64,6 +65,7 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
cfdata->dir = eina_stringshare_add("");
cfdata->show_label = ci->show_label;
cfdata->eap_label = ci->eap_label;
cfdata->lock_move = ci->lock_move;
}
static void *
@ -136,6 +138,13 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_generic, 1);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Icon Movement"), 0);
ob = e_widget_check_add(evas, _("Lock Icon Move"), &(cfdata->lock_move));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;
}
@ -150,6 +159,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (cfdata->dir) ci->dir = eina_stringshare_ref(cfdata->dir);
ci->show_label = cfdata->show_label;
ci->eap_label = cfdata->eap_label;
ci->lock_move = cfdata->lock_move;
_ibar_config_update(ci);
e_config_save_queue();
return 1;

View File

@ -513,6 +513,7 @@ _ibar_config_item_get(const char *id)
ci->dir = eina_stringshare_add("default");
ci->show_label = 1;
ci->eap_label = 0;
ci->lock_move= 0;
ibar_config->items = eina_list_append(ibar_config->items, ci);
return ci;
}
@ -902,28 +903,31 @@ _ibar_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *e
ev = event_info;
ic = data;
if ((ev->button == 1) && (!ic->drag.dnd) && (ic->mouse_down == 1))
if ((ev->button == 1) && (ic->mouse_down == 1))
{
if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar");
else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
if (!ic->drag.dnd)
{
if (!strncasecmp(ic->app->url, "file:", 5))
if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar");
else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
{
E_Action *act;
if (!strncasecmp(ic->app->url, "file:", 5))
{
E_Action *act;
act = e_action_find("fileman");
if (act) act->func.go(E_OBJECT(obj), ic->app->url + 5);
act = e_action_find("fileman");
if (act) act->func.go(E_OBJECT(obj), ic->app->url + 5);
}
}
/* TODO: bring back "e,action,start|stop" for the startup_notify apps
* when startup_notify is used again
*/
_ibar_icon_signal_emit(ic, "e,action,exec", "e");
}
ic->drag.start = 0;
ic->drag.dnd = 0;
ic->mouse_down = 0;
/* TODO: bring back "e,action,start|stop" for the startup_notify apps
* when startup_notify is used again
*/
_ibar_icon_signal_emit(ic, "e,action,exec", "e");
}
}
@ -954,6 +958,8 @@ _ibar_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
ic->drag.dnd = 1;
ic->drag.start = 0;
if (ic->ibar->inst->ci->lock_move) return;
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->container,
x, y, drag_types, 1,
@ -1237,6 +1243,7 @@ e_modapi_init(E_Module *m)
E_CONFIG_VAL(D, T, dir, STR);
E_CONFIG_VAL(D, T, show_label, INT);
E_CONFIG_VAL(D, T, eap_label, INT);
E_CONFIG_VAL(D, T, lock_move, INT);
conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config);
#undef T
@ -1258,6 +1265,7 @@ e_modapi_init(E_Module *m)
ci->dir = eina_stringshare_add("default");
ci->show_label = 1;
ci->eap_label = 0;
ci->lock_move= 0;
ibar_config->items = eina_list_append(ibar_config->items, ci);
}

View File

@ -22,6 +22,7 @@ struct _Config_Item
const char *dir;
int show_label;
int eap_label;
int lock_move;
};
EAPI extern E_Module_Api e_modapi;