summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorStephen Houston <stephen@localhost.localdomain>2017-10-11 14:02:06 -0500
committerStephen Houston <stephen@localhost.localdomain>2017-10-11 14:03:57 -0500
commit213bb6ba322d58070071d75b6dec0d8c9a8c2542 (patch)
treea9406c7f6ce28e9f82c74a8c6d34d78406425ddd /src/modules
parent28ff2091592fa63adbb90137fdd4b37fca868200 (diff)
Luncher: Keep aspect on previews - don't force max sizes.
This fixes T6074 T6075
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/luncher/bar.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/modules/luncher/bar.c b/src/modules/luncher/bar.c
index 838804e..75b3c37 100644
--- a/src/modules/luncher/bar.c
+++ b/src/modules/luncher/bar.c
@@ -765,7 +765,7 @@ static void
765_bar_icon_preview_client_add(Icon *ic, E_Client *ec) 765_bar_icon_preview_client_add(Icon *ic, E_Client *ec)
766{ 766{
767 Evas_Object *layout, *label, *img; 767 Evas_Object *layout, *label, *img;
768 Edje_Message_Int_Set *msg; 768 double aspect = 1.0;
769 769
770 layout = elm_layout_add(ic->preview_box); 770 layout = elm_layout_add(ic->preview_box);
771 evas_object_data_set(layout, "icon", ic); 771 evas_object_data_set(layout, "icon", ic);
@@ -779,11 +779,6 @@ _bar_icon_preview_client_add(Icon *ic, E_Client *ec)
779 elm_box_pack_end(ic->preview_box, layout); 779 elm_box_pack_end(ic->preview_box, layout);
780 evas_object_show(layout); 780 evas_object_show(layout);
781 781
782 msg = alloca(sizeof(Edje_Message_Int_Set) + (sizeof(int)));
783 msg->count = 1;
784 msg->val[0] = ic->inst->cfg->preview_size;
785 edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_INT_SET, 1, msg);
786
787 label = elm_label_add(layout); 782 label = elm_label_add(layout);
788 elm_object_style_set(label, "luncher_preview"); 783 elm_object_style_set(label, "luncher_preview");
789 elm_label_ellipsis_set(label, EINA_TRUE); 784 elm_label_ellipsis_set(label, EINA_TRUE);
@@ -792,8 +787,11 @@ _bar_icon_preview_client_add(Icon *ic, E_Client *ec)
792 elm_layout_content_set(layout, "e.swallow.title", label); 787 elm_layout_content_set(layout, "e.swallow.title", label);
793 evas_object_show(label); 788 evas_object_show(label);
794 789
790 aspect = (double)ec->client.w / (double)ec->client.h;
791
795 img = e_comp_object_util_mirror_add(ec->frame); 792 img = e_comp_object_util_mirror_add(ec->frame);
796 edje_extern_object_aspect_set(img, EDJE_ASPECT_CONTROL_BOTH, ec->client.w, ec->client.h); 793 edje_extern_object_aspect_set(img, EDJE_ASPECT_CONTROL_BOTH, ec->client.w, ec->client.h);
794 evas_object_size_hint_min_set(img, ic->inst->cfg->preview_size * aspect, ic->inst->cfg->preview_size);
797 elm_layout_content_set(layout, "e.swallow.icon", img); 795 elm_layout_content_set(layout, "e.swallow.icon", img);
798 if (evas_object_image_alpha_get(img)) 796 if (evas_object_image_alpha_get(img))
799 elm_layout_signal_emit(layout, "e,state,icon,alpha", "e"); 797 elm_layout_signal_emit(layout, "e,state,icon,alpha", "e");
@@ -843,7 +841,6 @@ _bar_icon_preview_show(void *data)
843 841
844 ic->preview = elm_ctxpopup_add(e_comp->elm); 842 ic->preview = elm_ctxpopup_add(e_comp->elm);
845 elm_object_style_set(ic->preview, "noblock"); 843 elm_object_style_set(ic->preview, "noblock");
846 evas_object_size_hint_min_set(ic->preview, ic->inst->cfg->preview_size, ic->inst->cfg->preview_size);
847 evas_object_smart_callback_add(ic->preview, "dismissed", _bar_popup_dismissed, ic); 844 evas_object_smart_callback_add(ic->preview, "dismissed", _bar_popup_dismissed, ic);
848 evas_object_event_callback_add(ic->preview, EVAS_CALLBACK_MOUSE_IN, 845 evas_object_event_callback_add(ic->preview, EVAS_CALLBACK_MOUSE_IN,
849 _bar_icon_preview_mouse_in, ic); 846 _bar_icon_preview_mouse_in, ic);