forked from enlightenment/enlightenment
fix only label option for gadget and filter out kbd layotu swithcing
options - use bindings. SVN revision: 70612
This commit is contained in:
parent
b8d5b3f45b
commit
1994364e64
|
@ -212,6 +212,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
|
||||
e_xkb_update();
|
||||
_xkb_update_icon();
|
||||
|
||||
e_config_save_queue();
|
||||
return 1;
|
||||
|
@ -285,7 +286,7 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
|
|||
Eina_List *l, *ll, *lll;
|
||||
Evas_Coord mw, mh;
|
||||
|
||||
Evas_Object *general = e_widget_framelist_add(evas, _("General"), 0);
|
||||
Evas_Object *general = e_widget_framelist_add(evas, _("Gadgets"), 0);
|
||||
{
|
||||
Evas_Object *only_label = e_widget_check_add(evas, _("Label only"), &(cfdata->only_label));
|
||||
{
|
||||
|
|
|
@ -135,11 +135,11 @@ _xkb_update_icon(void)
|
|||
evas_object_del(inst->o_xkbflag);
|
||||
inst->o_xkbflag = NULL;
|
||||
}
|
||||
|
||||
e_theme_edje_object_set(inst->o_xkbswitch,
|
||||
"base/theme/modules/xkbswitch",
|
||||
"modules/xkbswitch/noflag");
|
||||
edje_object_part_text_set(inst->o_xkbswitch, "e.text.label", name);
|
||||
edje_object_part_text_set(inst->o_xkbswitch,
|
||||
"e.text.label", name);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -148,6 +148,9 @@ _xkb_update_icon(void)
|
|||
{
|
||||
if (!inst->o_xkbflag)
|
||||
inst->o_xkbflag = e_icon_add(inst->gcc->gadcon->evas);
|
||||
e_theme_edje_object_set(inst->o_xkbswitch,
|
||||
"base/theme/modules/xkbswitch",
|
||||
"modules/xkbswitch/main");
|
||||
e_xkb_e_icon_flag_setup(inst->o_xkbflag, name);
|
||||
edje_object_part_swallow(inst->o_xkbswitch, "e.swallow.flag",
|
||||
inst->o_xkbflag);
|
||||
|
@ -174,9 +177,14 @@ _gc_init(E_Gadcon *gc, const char *gcname, const char *id, const char *style)
|
|||
inst = E_NEW(Instance, 1);
|
||||
/* The gadget */
|
||||
inst->o_xkbswitch = edje_object_add(gc->evas);
|
||||
e_theme_edje_object_set(inst->o_xkbswitch,
|
||||
"base/theme/modules/xkbswitch",
|
||||
"modules/xkbswitch/main");
|
||||
if (e_config->xkb.only_label)
|
||||
e_theme_edje_object_set(inst->o_xkbswitch,
|
||||
"base/theme/modules/xkbswitch",
|
||||
"modules/xkbswitch/noflag");
|
||||
else
|
||||
e_theme_edje_object_set(inst->o_xkbswitch,
|
||||
"base/theme/modules/xkbswitch",
|
||||
"modules/xkbswitch/main");
|
||||
edje_object_part_text_set(inst->o_xkbswitch, "e.text.label",
|
||||
e_xkb_layout_name_reduce(name));
|
||||
/* The gadcon client */
|
||||
|
|
|
@ -188,31 +188,35 @@ parse_rules(void)
|
|||
|
||||
p += strlen(name);
|
||||
while (p[0] == ' ') ++p;
|
||||
|
||||
if (!strchr(name, ':'))
|
||||
|
||||
/* skip "grp" options for switching kbd layouts */
|
||||
if (!(!strncmp(name, "grp", 3)))
|
||||
{
|
||||
group = E_NEW(E_XKB_Option_Group, 1);
|
||||
|
||||
/* A hack to get it to parse right if
|
||||
* the group name contains a space
|
||||
*/
|
||||
if (strstr(p, " "))
|
||||
if (!strchr(name, ':'))
|
||||
{
|
||||
p = strstr(p, " ");
|
||||
while (p[0] == ' ') ++p;
|
||||
group = E_NEW(E_XKB_Option_Group, 1);
|
||||
|
||||
/* A hack to get it to parse right if
|
||||
* the group name contains a space
|
||||
*/
|
||||
if (strstr(p, " "))
|
||||
{
|
||||
p = strstr(p, " ");
|
||||
while (p[0] == ' ') ++p;
|
||||
}
|
||||
|
||||
group->description = eina_stringshare_add(p);
|
||||
|
||||
optgroups = eina_list_append(optgroups, group);
|
||||
}
|
||||
else
|
||||
{
|
||||
option = E_NEW(E_XKB_Option, 1);
|
||||
option->name = eina_stringshare_add(name);
|
||||
option->description = eina_stringshare_add(p);
|
||||
group->options = eina_list_append(group->options,
|
||||
option);
|
||||
}
|
||||
|
||||
group->description = eina_stringshare_add(p);
|
||||
|
||||
optgroups = eina_list_append(optgroups, group);
|
||||
}
|
||||
else
|
||||
{
|
||||
option = E_NEW(E_XKB_Option, 1);
|
||||
option->name = eina_stringshare_add(name);
|
||||
option->description = eina_stringshare_add(p);
|
||||
|
||||
group->options = eina_list_append(group->options, option);
|
||||
}
|
||||
|
||||
free(tmp);
|
||||
|
|
Loading…
Reference in New Issue