summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-27 17:51:05 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-27 17:51:05 +0000
commit0667c3dca46ee5f8de1f16c736a8959c0a0fa88d (patch)
tree6dd960c5580f3c366dd90a3d5c6b093460e6ebbb
parent26445b9a81ac81978fc15f7e8f2051610d172068 (diff)
remove hover code entirelyHEADmaster
-rw-r--r--src/e_mod_main.c49
1 files changed, 9 insertions, 40 deletions
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index b7830dd..b8ebdf0 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -119,8 +119,6 @@ static void _forecasts_convert_pressures(float *value, int dir);
119static void _forecasts_display_set(Instance *inst, int ok); 119static void _forecasts_display_set(Instance *inst, int ok);
120static void _forecasts_popup_content_create(Instance *inst); 120static void _forecasts_popup_content_create(Instance *inst);
121static void _cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); 121static void _cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
122static void _cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
123static void _cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
124static Evas_Object *_forecasts_popup_icon_create(Evas *evas, const char *code); 122static Evas_Object *_forecasts_popup_icon_create(Evas *evas, const char *code);
125static void _forecasts_popup_destroy(Instance *inst); 123static void _forecasts_popup_destroy(Instance *inst);
126 124
@@ -151,10 +149,6 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
151 inst->forecasts_obj = o; 149 inst->forecasts_obj = o;
152 evas_object_event_callback_add(inst->forecasts_obj, EVAS_CALLBACK_MOUSE_UP, 150 evas_object_event_callback_add(inst->forecasts_obj, EVAS_CALLBACK_MOUSE_UP,
153 _cb_mouse_up, inst); 151 _cb_mouse_up, inst);
154 evas_object_event_callback_add(inst->forecasts_obj, EVAS_CALLBACK_MOUSE_IN,
155 _cb_mouse_in, inst);
156 evas_object_event_callback_add(inst->forecasts_obj, EVAS_CALLBACK_MOUSE_OUT,
157 _cb_mouse_out, inst);
158 152
159 if (!inst->url_data_handler) 153 if (!inst->url_data_handler)
160 inst->url_data_handler = 154 inst->url_data_handler =
@@ -1124,42 +1118,17 @@ _cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
1124 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 1118 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
1125 if (ev->button == 1) 1119 if (ev->button == 1)
1126 { 1120 {
1127 if (!inst->ci->popup_on_hover) 1121 if (!inst->popup)
1128 { 1122 {
1129 if (!inst->popup) 1123 _forecasts_popup_content_create(inst);
1130 { 1124 e_gadcon_popup_show(inst->popup);
1131 _forecasts_popup_content_create(inst); 1125 e_gadcon_popup_toggle_pinned(inst->popup);
1132 e_gadcon_popup_show(inst->popup); 1126 }
1133 e_gadcon_popup_toggle_pinned(inst->popup); 1127 else
1134 } 1128 {
1135 else 1129 _forecasts_popup_destroy(inst);
1136 { 1130 inst->popup = NULL;
1137 _forecasts_popup_destroy(inst);
1138 inst->popup = NULL;
1139 }
1140 } 1131 }
1141 } 1132 }
1142 1133
1143} 1134}
1144
1145static void
1146_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1147{
1148 Instance *inst = data;
1149
1150 if (!inst->ci->popup_on_hover) return;
1151 if (!inst->popup) _forecasts_popup_content_create(inst);
1152 e_gadcon_popup_show(inst->popup);
1153}
1154
1155static void
1156_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1157{
1158 Instance *inst = data;
1159
1160 if (!(inst->popup)) return;
1161 if (inst->popup->pinned) return;
1162 _forecasts_popup_destroy(inst);
1163 inst->popup = NULL;
1164}
1165