summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-01-05 23:42:14 +0100
committerBoris Faure <billiob@gmail.com>2018-01-05 23:42:14 +0100
commit08b5c20a27a8436f39083cd0d72315a376c42d51 (patch)
tree199865a3fcea7aefaf833529015b566aedd2effb /src/bin/controls.c
parentfd150de2226bdde9d9bba6a50721492ea6a93316 (diff)
controls: keep ctx when on about/options
Diffstat (limited to 'src/bin/controls.c')
-rw-r--r--src/bin/controls.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 98d6468..a472114 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -142,16 +142,33 @@ _cb_ct_close(void *data,
142} 142}
143 143
144static void 144static void
145_on_sub_done(void *data)
146{
147 struct controls_ctx *ctx = data;
148
149 ecore_timer_add(10.0, _cb_del_delay, ctx->frame);
150 ctx->frame = NULL;
151
152 if (ctx->donecb)
153 ctx->donecb(ctx->donedata);
154
155 eina_hash_del(controls, &ctx->win, ctx);
156
157 free(ctx);
158}
159
160static void
145_cb_ct_options(void *data, 161_cb_ct_options(void *data,
146 Evas_Object *_obj EINA_UNUSED, 162 Evas_Object *_obj EINA_UNUSED,
147 void *_event EINA_UNUSED) 163 void *_event EINA_UNUSED)
148{ 164{
149 struct controls_ctx *ctx = data; 165 struct controls_ctx *ctx = data;
150 166
151 options_show(ctx->win, ctx->bg, ctx->term, ctx->donecb, ctx->donedata); 167 options_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx);
152 controls_hide(ctx, EINA_FALSE); 168 controls_hide(ctx, EINA_FALSE);
153} 169}
154 170
171
155static void 172static void
156_cb_ct_about(void *data, 173_cb_ct_about(void *data,
157 Evas_Object *_obj EINA_UNUSED, 174 Evas_Object *_obj EINA_UNUSED,
@@ -159,7 +176,7 @@ _cb_ct_about(void *data,
159{ 176{
160 struct controls_ctx *ctx = data; 177 struct controls_ctx *ctx = data;
161 178
162 about_show(ctx->win, ctx->bg, ctx->term, ctx->donecb, ctx->donedata); 179 about_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx);
163 controls_hide(ctx, EINA_FALSE); 180 controls_hide(ctx, EINA_FALSE);
164} 181}
165 182
@@ -259,15 +276,18 @@ controls_hide(struct controls_ctx *ctx, Eina_Bool call_cb)
259 } 276 }
260 elm_object_focus_set(ctx->frame, EINA_FALSE); 277 elm_object_focus_set(ctx->frame, EINA_FALSE);
261 278
262 ecore_timer_add(10.0, _cb_del_delay, ctx->frame); 279 if (call_cb)
263 ctx->frame = NULL; 280 {
281 ecore_timer_add(10.0, _cb_del_delay, ctx->frame);
282 ctx->frame = NULL;
264 283
265 if (call_cb && ctx->donecb) 284 if (ctx->donecb)
266 ctx->donecb(ctx->donedata); 285 ctx->donecb(ctx->donedata);
267 286
268 eina_hash_del(controls, &ctx->win, ctx); 287 eina_hash_del(controls, &ctx->win, ctx);
269 288
270 free(ctx); 289 free(ctx);
290 }
271} 291}
272 292
273 293