summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-07-07 15:59:28 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-07 15:59:28 +0100
commit3bbab5a22fd047a2cad066be734a69d1df4f98d0 (patch)
tree8a69ceb961b8a4dfb3c249adf8134162fdd5e36b /src
parent979a8e895314aecdcd79517d41dd473f74c02ea9 (diff)
ibox: Add Live Preview Optional View.
Reviewers: raster, devilhorns Subscribers: cedric, zmike Tags: #enlightenment-git Differential Revision: https://phab.enlightenment.org/D12046
Diffstat (limited to 'src')
-rw-r--r--src/modules/ibox/e_mod_config.c8
-rw-r--r--src/modules/ibox/e_mod_main.c36
-rw-r--r--src/modules/ibox/e_mod_main.h1
3 files changed, 44 insertions, 1 deletions
diff --git a/src/modules/ibox/e_mod_config.c b/src/modules/ibox/e_mod_config.c
index d0ade272a..83fc2feba 100644
--- a/src/modules/ibox/e_mod_config.c
+++ b/src/modules/ibox/e_mod_config.c
@@ -8,6 +8,7 @@ struct _E_Config_Dialog_Data
8 int desk_policy; 8 int desk_policy;
9 int icon_label; 9 int icon_label;
10 int expand_on_desktop; 10 int expand_on_desktop;
11 int show_preview;
11 struct 12 struct
12 { 13 {
13 Evas_Object *o_desk_show_all; 14 Evas_Object *o_desk_show_all;
@@ -59,6 +60,8 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
59 cfdata->zone_policy = ci->show_zone; 60 cfdata->zone_policy = ci->show_zone;
60 cfdata->desk_policy = ci->show_desk; 61 cfdata->desk_policy = ci->show_desk;
61 cfdata->icon_label = ci->icon_label; 62 cfdata->icon_label = ci->icon_label;
63 cfdata->expand_on_desktop = ci->expand_on_desktop;
64 cfdata->show_preview = ci->show_preview;
62} 65}
63 66
64static void * 67static void *
@@ -93,6 +96,10 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
93 o = e_widget_list_add(evas, 0, 0); 96 o = e_widget_list_add(evas, 0, 0);
94 97
95 of = e_widget_framelist_add(evas, _("General Settings"), 0); 98 of = e_widget_framelist_add(evas, _("General Settings"), 0);
99
100 ob = e_widget_check_add(evas, _("Preview"), &(cfdata->show_preview));
101 e_widget_framelist_object_append(of, ob);
102
96 ob = e_widget_check_add(evas, _("Expand When On Desktop"), &(cfdata->expand_on_desktop)); 103 ob = e_widget_check_add(evas, _("Expand When On Desktop"), &(cfdata->expand_on_desktop));
97 e_widget_framelist_object_append(of, ob); 104 e_widget_framelist_object_append(of, ob);
98 105
@@ -177,6 +184,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
177 ci->show_zone = cfdata->zone_policy; 184 ci->show_zone = cfdata->zone_policy;
178 ci->show_desk = cfdata->desk_policy; 185 ci->show_desk = cfdata->desk_policy;
179 ci->expand_on_desktop = cfdata->expand_on_desktop; 186 ci->expand_on_desktop = cfdata->expand_on_desktop;
187 ci->show_preview = cfdata->show_preview;
180 188
181 _ibox_config_update(ci); 189 _ibox_config_update(ci);
182 e_config_save_queue(); 190 e_config_save_queue();
diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c
index 3d7c00447..7cfe79cad 100644
--- a/src/modules/ibox/e_mod_main.c
+++ b/src/modules/ibox/e_mod_main.c
@@ -563,7 +563,7 @@ _ibox_icon_free(IBox_Icon *ic)
563} 563}
564 564
565static void 565static void
566_ibox_icon_fill(IBox_Icon *ic) 566_ibox_icon_fill_icon(IBox_Icon *ic)
567{ 567{
568 ic->o_icon = e_client_icon_add(ic->client, evas_object_evas_get(ic->ibox->o_box)); 568 ic->o_icon = e_client_icon_add(ic->client, evas_object_evas_get(ic->ibox->o_box));
569 edje_object_part_swallow(ic->o_holder, "e.swallow.content", ic->o_icon); 569 edje_object_part_swallow(ic->o_holder, "e.swallow.content", ic->o_icon);
@@ -573,6 +573,39 @@ _ibox_icon_fill(IBox_Icon *ic)
573 edje_object_part_swallow(ic->o_holder2, "e.swallow.content", ic->o_icon2); 573 edje_object_part_swallow(ic->o_holder2, "e.swallow.content", ic->o_icon2);
574 evas_object_pass_events_set(ic->o_icon2, 1); 574 evas_object_pass_events_set(ic->o_icon2, 1);
575 evas_object_show(ic->o_icon2); 575 evas_object_show(ic->o_icon2);
576}
577
578static void
579_ibox_icon_fill_preview(IBox_Icon *ic)
580{
581 E_Client *ec;
582 Evas_Object *img, *img2;
583
584 ec = ic->client;
585
586 img = e_comp_object_util_mirror_add(ec->frame);
587 evas_object_size_hint_aspect_set(img, EVAS_ASPECT_CONTROL_BOTH, ec->client.w, ec->client.h);
588 evas_object_size_hint_max_set(img, ec->client.w, ec->client.h);
589 ic->o_icon = img;
590 edje_object_part_swallow(ic->o_holder, "e.swallow.preview", ic->o_icon);
591 evas_object_pass_events_set(ic->o_icon, 1);
592 evas_object_show(ic->o_icon);
593
594 img2 = e_comp_object_util_mirror_add(ec->frame);
595 evas_object_size_hint_aspect_set(img2, EVAS_ASPECT_CONTROL_BOTH, ec->client.w, ec->client.h);
596 ic->o_icon2 = img2;
597 edje_object_part_swallow(ic->o_holder2, "e.swallow.preview", ic->o_icon2);
598 evas_object_pass_events_set(ic->o_icon2, 1);
599 evas_object_show(ic->o_icon2);
600}
601
602static void
603_ibox_icon_fill(IBox_Icon *ic)
604{
605 if ((ic->ibox->inst->ci->show_preview) && (edje_object_part_exists(ic->o_holder, "e.swallow.preview")))
606 _ibox_icon_fill_preview(ic);
607 else
608 _ibox_icon_fill_icon(ic);
576 609
577 _ibox_icon_fill_label(ic); 610 _ibox_icon_fill_label(ic);
578 611
@@ -1297,6 +1330,7 @@ e_modapi_init(E_Module *m)
1297 E_CONFIG_VAL(D, T, show_zone, INT); 1330 E_CONFIG_VAL(D, T, show_zone, INT);
1298 E_CONFIG_VAL(D, T, show_desk, INT); 1331 E_CONFIG_VAL(D, T, show_desk, INT);
1299 E_CONFIG_VAL(D, T, icon_label, INT); 1332 E_CONFIG_VAL(D, T, icon_label, INT);
1333 E_CONFIG_VAL(D, T, show_preview, INT);
1300 1334
1301 conf_edd = E_CONFIG_DD_NEW("IBox_Config", Config); 1335 conf_edd = E_CONFIG_DD_NEW("IBox_Config", Config);
1302 #undef T 1336 #undef T
diff --git a/src/modules/ibox/e_mod_main.h b/src/modules/ibox/e_mod_main.h
index 32a104c0c..58d79998d 100644
--- a/src/modules/ibox/e_mod_main.h
+++ b/src/modules/ibox/e_mod_main.h
@@ -22,6 +22,7 @@ struct _Config_Item
22 int show_desk; 22 int show_desk;
23 int icon_label; 23 int icon_label;
24 int expand_on_desktop; 24 int expand_on_desktop;
25 int show_preview;
25 E_Gadcon_Client *gcc; 26 E_Gadcon_Client *gcc;
26}; 27};
27 28