summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-01-15 22:45:32 +0100
committerBoris Faure <billiob@gmail.com>2018-01-15 22:45:32 +0100
commit820a5440fe348fabe78fed3aeb87c6a53b5a4855 (patch)
treea9b2ff9cecb99a622fef844995068d99d31133e7 /src/bin/controls.c
parenta66225dc87e4a82d8ed33e241cb9bb642a3558e6 (diff)
controls: use both "bg" and "base" evas objects
Diffstat (limited to 'src/bin/controls.c')
-rw-r--r--src/bin/controls.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 89fbc8d..f51a1c0 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -14,6 +14,7 @@ typedef struct _Controls_Ctx {
14 Evas_Object *frame; 14 Evas_Object *frame;
15 Evas_Object *over; 15 Evas_Object *over;
16 Evas_Object *win; 16 Evas_Object *win;
17 Evas_Object *base;
17 Evas_Object *bg; 18 Evas_Object *bg;
18 Evas_Object *term; 19 Evas_Object *term;
19 void (*donecb) (void *data); 20 void (*donecb) (void *data);
@@ -164,7 +165,7 @@ _cb_ct_options(void *data,
164{ 165{
165 Controls_Ctx *ctx = data; 166 Controls_Ctx *ctx = data;
166 167
167 options_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx); 168 options_show(ctx->win, ctx->base, ctx->bg, ctx->term, _on_sub_done, ctx);
168 controls_hide(ctx, EINA_FALSE); 169 controls_hide(ctx, EINA_FALSE);
169} 170}
170 171
@@ -176,7 +177,7 @@ _cb_ct_about(void *data,
176{ 177{
177 Controls_Ctx *ctx = data; 178 Controls_Ctx *ctx = data;
178 179
179 about_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx); 180 about_show(ctx->win, ctx->base, ctx->term, _on_sub_done, ctx);
180 controls_hide(ctx, EINA_FALSE); 181 controls_hide(ctx, EINA_FALSE);
181} 182}
182 183
@@ -267,7 +268,7 @@ controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb)
267 if (ctx->term) 268 if (ctx->term)
268 { 269 {
269 evas_object_event_callback_del(ctx->term, EVAS_CALLBACK_DEL, _cb_saved_del); 270 evas_object_event_callback_del(ctx->term, EVAS_CALLBACK_DEL, _cb_saved_del);
270 edje_object_signal_emit(ctx->bg, "controls,hide", "terminology"); 271 edje_object_signal_emit(ctx->base, "controls,hide", "terminology");
271 } 272 }
272 273
273 if (ctx->over) 274 if (ctx->over)
@@ -292,8 +293,8 @@ controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb)
292 293
293 294
294void 295void
295controls_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term, 296controls_show(Evas_Object *win, Evas_Object *base, Evas_Object *bg,
296 void (*donecb) (void *data), void *donedata) 297 Evas_Object *term, void (*donecb) (void *data), void *donedata)
297{ 298{
298 Evas_Object *o; 299 Evas_Object *o;
299 Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3; 300 Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3;
@@ -309,6 +310,7 @@ controls_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
309 ctx = malloc(sizeof(*ctx)); 310 ctx = malloc(sizeof(*ctx));
310 assert(ctx); 311 assert(ctx);
311 ctx->win = win; 312 ctx->win = win;
313 ctx->base = base;
312 ctx->bg = bg; 314 ctx->bg = bg;
313 ctx->term = term; 315 ctx->term = term;
314 ctx->donecb = donecb; 316 ctx->donecb = donecb;
@@ -406,16 +408,16 @@ controls_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
406 evas_object_smart_callback_add(win, "selection,off", _cb_sel_off, 408 evas_object_smart_callback_add(win, "selection,off", _cb_sel_off,
407 ctx); 409 ctx);
408 410
409 edje_object_part_swallow(bg, "terminology.controls", ctx->frame); 411 edje_object_part_swallow(base, "terminology.controls", ctx->frame);
410 evas_object_show(ctx->frame); 412 evas_object_show(ctx->frame);
411 ctx->over = o = evas_object_rectangle_add(evas_object_evas_get(win)); 413 ctx->over = o = evas_object_rectangle_add(evas_object_evas_get(win));
412 evas_object_color_set(o, 0, 0, 0, 0); 414 evas_object_color_set(o, 0, 0, 0, 0);
413 edje_object_part_swallow(bg, "terminology.dismiss", o); 415 edje_object_part_swallow(base, "terminology.dismiss", o);
414 evas_object_show(o); 416 evas_object_show(o);
415 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, 417 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
416 _cb_mouse_down, ctx); 418 _cb_mouse_down, ctx);
417 419
418 edje_object_signal_emit(bg, "controls,show", "terminology"); 420 edje_object_signal_emit(base, "controls,show", "terminology");
419 elm_object_focus_set(ctx->frame, EINA_TRUE); 421 elm_object_focus_set(ctx->frame, EINA_TRUE);
420 evas_object_event_callback_add(ctx->win, EVAS_CALLBACK_DEL, _cb_saved_del, ctx); 422 evas_object_event_callback_add(ctx->win, EVAS_CALLBACK_DEL, _cb_saved_del, ctx);
421 evas_object_event_callback_add(ctx->term, EVAS_CALLBACK_DEL, _cb_saved_del, ctx); 423 evas_object_event_callback_add(ctx->term, EVAS_CALLBACK_DEL, _cb_saved_del, ctx);