forked from enlightenment/enlightenment
ibox: Add Live Preview Optional View.
Reviewers: raster, devilhorns Subscribers: cedric, zmike Tags: #enlightenment-git Differential Revision: https://phab.enlightenment.org/D12046
This commit is contained in:
parent
979a8e8953
commit
3bbab5a22f
|
@ -8,6 +8,7 @@ struct _E_Config_Dialog_Data
|
|||
int desk_policy;
|
||||
int icon_label;
|
||||
int expand_on_desktop;
|
||||
int show_preview;
|
||||
struct
|
||||
{
|
||||
Evas_Object *o_desk_show_all;
|
||||
|
@ -59,6 +60,8 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
|
|||
cfdata->zone_policy = ci->show_zone;
|
||||
cfdata->desk_policy = ci->show_desk;
|
||||
cfdata->icon_label = ci->icon_label;
|
||||
cfdata->expand_on_desktop = ci->expand_on_desktop;
|
||||
cfdata->show_preview = ci->show_preview;
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -93,6 +96,10 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
|
|||
o = e_widget_list_add(evas, 0, 0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
||||
|
||||
ob = e_widget_check_add(evas, _("Preview"), &(cfdata->show_preview));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_check_add(evas, _("Expand When On Desktop"), &(cfdata->expand_on_desktop));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
|
@ -177,6 +184,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
ci->show_zone = cfdata->zone_policy;
|
||||
ci->show_desk = cfdata->desk_policy;
|
||||
ci->expand_on_desktop = cfdata->expand_on_desktop;
|
||||
ci->show_preview = cfdata->show_preview;
|
||||
|
||||
_ibox_config_update(ci);
|
||||
e_config_save_queue();
|
||||
|
|
|
@ -563,7 +563,7 @@ _ibox_icon_free(IBox_Icon *ic)
|
|||
}
|
||||
|
||||
static void
|
||||
_ibox_icon_fill(IBox_Icon *ic)
|
||||
_ibox_icon_fill_icon(IBox_Icon *ic)
|
||||
{
|
||||
ic->o_icon = e_client_icon_add(ic->client, evas_object_evas_get(ic->ibox->o_box));
|
||||
edje_object_part_swallow(ic->o_holder, "e.swallow.content", ic->o_icon);
|
||||
|
@ -573,6 +573,39 @@ _ibox_icon_fill(IBox_Icon *ic)
|
|||
edje_object_part_swallow(ic->o_holder2, "e.swallow.content", ic->o_icon2);
|
||||
evas_object_pass_events_set(ic->o_icon2, 1);
|
||||
evas_object_show(ic->o_icon2);
|
||||
}
|
||||
|
||||
static void
|
||||
_ibox_icon_fill_preview(IBox_Icon *ic)
|
||||
{
|
||||
E_Client *ec;
|
||||
Evas_Object *img, *img2;
|
||||
|
||||
ec = ic->client;
|
||||
|
||||
img = e_comp_object_util_mirror_add(ec->frame);
|
||||
evas_object_size_hint_aspect_set(img, EVAS_ASPECT_CONTROL_BOTH, ec->client.w, ec->client.h);
|
||||
evas_object_size_hint_max_set(img, ec->client.w, ec->client.h);
|
||||
ic->o_icon = img;
|
||||
edje_object_part_swallow(ic->o_holder, "e.swallow.preview", ic->o_icon);
|
||||
evas_object_pass_events_set(ic->o_icon, 1);
|
||||
evas_object_show(ic->o_icon);
|
||||
|
||||
img2 = e_comp_object_util_mirror_add(ec->frame);
|
||||
evas_object_size_hint_aspect_set(img2, EVAS_ASPECT_CONTROL_BOTH, ec->client.w, ec->client.h);
|
||||
ic->o_icon2 = img2;
|
||||
edje_object_part_swallow(ic->o_holder2, "e.swallow.preview", ic->o_icon2);
|
||||
evas_object_pass_events_set(ic->o_icon2, 1);
|
||||
evas_object_show(ic->o_icon2);
|
||||
}
|
||||
|
||||
static void
|
||||
_ibox_icon_fill(IBox_Icon *ic)
|
||||
{
|
||||
if ((ic->ibox->inst->ci->show_preview) && (edje_object_part_exists(ic->o_holder, "e.swallow.preview")))
|
||||
_ibox_icon_fill_preview(ic);
|
||||
else
|
||||
_ibox_icon_fill_icon(ic);
|
||||
|
||||
_ibox_icon_fill_label(ic);
|
||||
|
||||
|
@ -1297,6 +1330,7 @@ e_modapi_init(E_Module *m)
|
|||
E_CONFIG_VAL(D, T, show_zone, INT);
|
||||
E_CONFIG_VAL(D, T, show_desk, INT);
|
||||
E_CONFIG_VAL(D, T, icon_label, INT);
|
||||
E_CONFIG_VAL(D, T, show_preview, INT);
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("IBox_Config", Config);
|
||||
#undef T
|
||||
|
|
|
@ -22,6 +22,7 @@ struct _Config_Item
|
|||
int show_desk;
|
||||
int icon_label;
|
||||
int expand_on_desktop;
|
||||
int show_preview;
|
||||
E_Gadcon_Client *gcc;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue