forked from enlightenment/enlightenment
add tasks options for icon/text only modes
still needs a bit of edc work from someone to size better ticket #1334 SVN revision: 75260
This commit is contained in:
parent
8da7dd34b1
commit
847a27afb0
|
@ -3,8 +3,11 @@
|
|||
|
||||
struct _E_Config_Dialog_Data
|
||||
{
|
||||
Evas_Object *icon, *text;
|
||||
int show_all;
|
||||
int minw, minh;
|
||||
int icon_only;
|
||||
int text_only;
|
||||
};
|
||||
|
||||
/* Protos */
|
||||
|
@ -41,6 +44,8 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
|
|||
cfdata->show_all = ci->show_all;
|
||||
cfdata->minw = ci->minw;
|
||||
cfdata->minh = ci->minh;
|
||||
cfdata->icon_only = ci->icon_only;
|
||||
cfdata->text_only = ci->text_only;
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -63,6 +68,14 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
free(cfdata);
|
||||
}
|
||||
|
||||
static void
|
||||
_toggle_check(void *data, Evas_Object *obj __UNUSED__)
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata = data;
|
||||
e_widget_disabled_set(cfdata->text, cfdata->icon_only);
|
||||
e_widget_disabled_set(cfdata->icon, cfdata->text_only);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
|
@ -74,6 +87,14 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
|
|||
ob = e_widget_check_add(evas, _("Show windows from all desktops"),
|
||||
&(cfdata->show_all));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
cfdata->icon = ob = e_widget_check_add(evas, _("Show icon only"),
|
||||
&(cfdata->icon_only));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_on_change_hook_set(ob, _toggle_check, cfdata);
|
||||
cfdata->text = ob = e_widget_check_add(evas, _("Show text only"),
|
||||
&(cfdata->text_only));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_on_change_hook_set(ob, _toggle_check, cfdata);
|
||||
ow = e_widget_label_add(evas, _("Minimum Width"));
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f px"), 20, 420, 1, 0,
|
||||
|
@ -84,6 +105,7 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
|
|||
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f px"), 20, 420, 1, 0,
|
||||
NULL, &(cfdata->minh), 100);
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
_toggle_check(cfdata, NULL);
|
||||
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
return o;
|
||||
|
@ -98,6 +120,8 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
ci->show_all = cfdata->show_all;
|
||||
ci->minw = cfdata->minw;
|
||||
ci->minh = cfdata->minh;
|
||||
ci->icon_only = cfdata->icon_only;
|
||||
ci->text_only = cfdata->text_only;
|
||||
e_config_save_queue();
|
||||
_tasks_config_updated(ci);
|
||||
return 1;
|
||||
|
|
|
@ -110,6 +110,8 @@ e_modapi_init(E_Module *m)
|
|||
E_CONFIG_VAL(D, T, show_all, INT);
|
||||
E_CONFIG_VAL(D, T, minw, INT);
|
||||
E_CONFIG_VAL(D, T, minh, INT);
|
||||
E_CONFIG_VAL(D, T, icon_only, UCHAR);
|
||||
E_CONFIG_VAL(D, T, text_only, UCHAR);
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("Tasks_Config", Config);
|
||||
|
||||
|
@ -565,12 +567,20 @@ _tasks_item_fill(Tasks_Item *item)
|
|||
{
|
||||
const char *label;
|
||||
|
||||
item->o_icon = e_border_icon_add(item->border, evas_object_evas_get(item->tasks->o_items));
|
||||
edje_object_part_swallow(item->o_item, "e.swallow.icon", item->o_icon);
|
||||
evas_object_pass_events_set(item->o_icon, 1);
|
||||
evas_object_show(item->o_icon);
|
||||
if (item->tasks->config->text_only)
|
||||
item->o_icon = NULL;
|
||||
else
|
||||
{
|
||||
item->o_icon = e_border_icon_add(item->border, evas_object_evas_get(item->tasks->o_items));
|
||||
edje_object_part_swallow(item->o_item, "e.swallow.icon", item->o_icon);
|
||||
evas_object_pass_events_set(item->o_icon, 1);
|
||||
evas_object_show(item->o_icon);
|
||||
}
|
||||
|
||||
label = e_border_name_get(item->border);
|
||||
if (item->tasks->config->icon_only)
|
||||
label = "";
|
||||
else
|
||||
label = e_border_name_get(item->border);
|
||||
edje_object_part_text_set(item->o_item, "e.text.label", label);
|
||||
|
||||
if (item->border->iconic)
|
||||
|
|
|
@ -20,6 +20,8 @@ struct _Config_Item
|
|||
const char *id;
|
||||
int show_all;
|
||||
int minw, minh;
|
||||
Eina_Bool icon_only;
|
||||
Eina_Bool text_only;
|
||||
};
|
||||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
|
Loading…
Reference in New Issue