forked from enlightenment/enlightenment
IBox now has config options for setting what is displayed in icon label.
Note: May need to "grandma"-ize this :) SVN revision: 23104
This commit is contained in:
parent
d13e0da18a
commit
738604bb20
|
@ -7,10 +7,9 @@
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
int show_label;
|
int show_label;
|
||||||
|
|
||||||
int zone_policy;
|
int zone_policy;
|
||||||
int desk_policy;
|
int desk_policy;
|
||||||
|
int icon_label;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
Evas_Object *o_desk_show_all;
|
Evas_Object *o_desk_show_all;
|
||||||
|
@ -57,6 +56,7 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
|
||||||
cfdata->show_label = ci->show_label;
|
cfdata->show_label = ci->show_label;
|
||||||
cfdata->zone_policy = ci->show_zone;
|
cfdata->zone_policy = ci->show_zone;
|
||||||
cfdata->desk_policy = ci->show_desk;
|
cfdata->desk_policy = ci->show_desk;
|
||||||
|
cfdata->icon_label = ci->icon_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -93,6 +93,16 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
||||||
ob = e_widget_check_add(evas, _("Show Icon Label"), &(cfdata->show_label));
|
ob = e_widget_check_add(evas, _("Show Icon Label"), &(cfdata->show_label));
|
||||||
e_widget_framelist_object_append(of, ob);
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
rg = e_widget_radio_group_new(&(cfdata->icon_label));
|
||||||
|
ob = e_widget_radio_add(evas, _("Display Name"), 0, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Display Title"), 1, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Display Class"), 2, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Display Icon Name"), 3, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Zone"), 0);
|
of = e_widget_framelist_add(evas, _("Zone"), 0);
|
||||||
|
@ -151,7 +161,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
|
|
||||||
ci = cfd->data;
|
ci = cfd->data;
|
||||||
ci->show_label = cfdata->show_label;
|
ci->show_label = cfdata->show_label;
|
||||||
|
ci->icon_label = cfdata->icon_label;
|
||||||
ci->show_zone = cfdata->zone_policy;
|
ci->show_zone = cfdata->zone_policy;
|
||||||
ci->show_desk = cfdata->desk_policy;
|
ci->show_desk = cfdata->desk_policy;
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ struct _IBox
|
||||||
int show_label;
|
int show_label;
|
||||||
int show_zone;
|
int show_zone;
|
||||||
int show_desk;
|
int show_desk;
|
||||||
|
int icon_label;
|
||||||
E_Zone *zone;
|
E_Zone *zone;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -143,6 +144,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
b->show_label = ci->show_label;
|
b->show_label = ci->show_label;
|
||||||
b->show_zone = ci->show_zone;
|
b->show_zone = ci->show_zone;
|
||||||
b->show_desk = ci->show_desk;
|
b->show_desk = ci->show_desk;
|
||||||
|
b->icon_label = ci->icon_label;
|
||||||
_ibox_fill(b);
|
_ibox_fill(b);
|
||||||
|
|
||||||
b->inst = inst;
|
b->inst = inst;
|
||||||
|
@ -541,11 +543,23 @@ _ibox_icon_fill(IBox_Icon *ic)
|
||||||
evas_object_show(ic->o_icon2);
|
evas_object_show(ic->o_icon2);
|
||||||
|
|
||||||
/* FIXME: preferences for icon name */
|
/* FIXME: preferences for icon name */
|
||||||
label = ic->border->client.netwm.icon_name;
|
switch (ic->ibox->icon_label)
|
||||||
if (!label) label = ic->border->client.icccm.icon_name;
|
{
|
||||||
if (!label) label = ic->border->client.icccm.class;
|
case 0:
|
||||||
if (!label) label = ic->border->client.netwm.name;
|
label = ic->border->client.netwm.name;
|
||||||
if (!label) label = ic->border->client.icccm.title;
|
break;
|
||||||
|
case 1:
|
||||||
|
label = ic->border->client.icccm.title;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
label = ic->border->client.icccm.class;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
label = ic->border->client.netwm.icon_name;
|
||||||
|
if (!label) label = ic->border->client.icccm.icon_name;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!label) label = "?";
|
if (!label) label = "?";
|
||||||
edje_object_part_text_set(ic->o_holder, "label", label);
|
edje_object_part_text_set(ic->o_holder, "label", label);
|
||||||
edje_object_part_text_set(ic->o_holder2, "label", label);
|
edje_object_part_text_set(ic->o_holder2, "label", label);
|
||||||
|
@ -1207,6 +1221,7 @@ _ibox_config_item_get(const char *id)
|
||||||
ci->show_label = 0;
|
ci->show_label = 0;
|
||||||
ci->show_zone = 1;
|
ci->show_zone = 1;
|
||||||
ci->show_desk = 0;
|
ci->show_desk = 0;
|
||||||
|
ci->icon_label = 0;
|
||||||
ibox_config->items = evas_list_append(ibox_config->items, ci);
|
ibox_config->items = evas_list_append(ibox_config->items, ci);
|
||||||
return ci;
|
return ci;
|
||||||
}
|
}
|
||||||
|
@ -1225,7 +1240,8 @@ _ibox_config_update(void)
|
||||||
inst->ibox->show_label = ci->show_label;
|
inst->ibox->show_label = ci->show_label;
|
||||||
inst->ibox->show_zone = ci->show_zone;
|
inst->ibox->show_zone = ci->show_zone;
|
||||||
inst->ibox->show_desk = ci->show_desk;
|
inst->ibox->show_desk = ci->show_desk;
|
||||||
|
inst->ibox->icon_label = ci->icon_label;
|
||||||
|
|
||||||
_ibox_empty(inst->ibox);
|
_ibox_empty(inst->ibox);
|
||||||
_ibox_fill(inst->ibox);
|
_ibox_fill(inst->ibox);
|
||||||
_ibox_resize_handle(inst->ibox);
|
_ibox_resize_handle(inst->ibox);
|
||||||
|
@ -1278,6 +1294,7 @@ e_modapi_init(E_Module *m)
|
||||||
E_CONFIG_VAL(D, T, show_label, INT);
|
E_CONFIG_VAL(D, T, show_label, INT);
|
||||||
E_CONFIG_VAL(D, T, show_zone, INT);
|
E_CONFIG_VAL(D, T, show_zone, INT);
|
||||||
E_CONFIG_VAL(D, T, show_desk, INT);
|
E_CONFIG_VAL(D, T, show_desk, INT);
|
||||||
|
E_CONFIG_VAL(D, T, icon_label, INT);
|
||||||
|
|
||||||
conf_edd = E_CONFIG_DD_NEW("IBox_Config", Config);
|
conf_edd = E_CONFIG_DD_NEW("IBox_Config", Config);
|
||||||
#undef T
|
#undef T
|
||||||
|
@ -1298,6 +1315,7 @@ e_modapi_init(E_Module *m)
|
||||||
ci->show_label = 0;
|
ci->show_label = 0;
|
||||||
ci->show_zone = 1;
|
ci->show_zone = 1;
|
||||||
ci->show_desk = 0;
|
ci->show_desk = 0;
|
||||||
|
ci->icon_label = 0;
|
||||||
ibox_config->items = evas_list_append(ibox_config->items, ci);
|
ibox_config->items = evas_list_append(ibox_config->items, ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ struct _Config_Item
|
||||||
int show_label;
|
int show_label;
|
||||||
int show_zone;
|
int show_zone;
|
||||||
int show_desk;
|
int show_desk;
|
||||||
|
int icon_label;
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
EAPI extern E_Module_Api e_modapi;
|
||||||
|
|
Loading…
Reference in New Issue