aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/options.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/options.c
parentoptions_colors: be able to have multiple instances (diff)
downloadterminology-820a5440fe348fabe78fed3aeb87c6a53b5a4855.tar.gz
controls: use both "bg" and "base" evas objects
Diffstat (limited to 'src/bin/options.c')
-rw-r--r--src/bin/options.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/bin/options.c b/src/bin/options.c
index 845f7e9..0d08ba7 100644
--- a/src/bin/options.c
+++ b/src/bin/options.c
@@ -38,6 +38,7 @@ typedef struct _Options_Ctx {
Evas_Object *opbox;
Evas_Object *over;
Evas_Object *win;
+ Evas_Object *base;
Evas_Object *bg;
Evas_Object *term;
Config *config;
@@ -60,7 +61,7 @@ _cb_op(void *data,
ctx->mode = mode;
- edje_object_signal_emit(ctx->bg, "optdetails,hide", "terminology");
+ edje_object_signal_emit(ctx->base, "optdetails,hide", "terminology");
}
static void
@@ -100,7 +101,7 @@ _cb_opdt_hide_done(void *data,
case OPTION_FONT: options_font(ctx->opbox, ctx->term); break;
case OPTION_THEME: options_theme(ctx->opbox, ctx->term); break;
case OPTION_BACKGROUND: options_background(ctx->opbox, ctx->term); break;
- case OPTION_COLORS: options_colors(ctx->opbox, ctx->term); break;
+ case OPTION_COLORS: options_colors(ctx->opbox, ctx->term, ctx->bg); break;
case OPTION_VIDEO: options_video(ctx->opbox, ctx->term); break;
case OPTION_BEHAVIOR: options_behavior(ctx->opbox, ctx->term); break;
case OPTION_KEYS: options_keys(ctx->opbox, ctx->term); break;
@@ -108,7 +109,7 @@ _cb_opdt_hide_done(void *data,
case OPTION_ELM: options_elm(ctx->opbox, ctx->term); break;
case OPTIONS_MODE_NB: assert(0 && "should not occur");
}
- edje_object_signal_emit(ctx->bg, "optdetails,show", "terminology");
+ edje_object_signal_emit(ctx->base, "optdetails,show", "terminology");
}
static void
@@ -119,7 +120,7 @@ _cb_opdt_hide_done2(void *data,
{
Options_Ctx *ctx = data;
- edje_object_signal_callback_del(ctx->bg, "optdetails,hide,done",
+ edje_object_signal_callback_del(ctx->base, "optdetails,hide,done",
"terminology",
_cb_opdt_hide_done2);
ecore_timer_add(10.0, _cb_op_del_delay, ctx);
@@ -128,15 +129,15 @@ _cb_opdt_hide_done2(void *data,
static void
options_hide(Options_Ctx *ctx)
{
- edje_object_part_swallow(ctx->bg, "terminology.optdetails", ctx->opbox);
- edje_object_part_swallow(ctx->bg, "terminology.options", ctx->frame);
- edje_object_signal_emit(ctx->bg, "optdetails,show", "terminology");
- edje_object_signal_emit(ctx->bg, "options,show", "terminology");
+ edje_object_part_swallow(ctx->base, "terminology.optdetails", ctx->opbox);
+ edje_object_part_swallow(ctx->base, "terminology.options", ctx->frame);
+ edje_object_signal_emit(ctx->base, "optdetails,show", "terminology");
+ edje_object_signal_emit(ctx->base, "options,show", "terminology");
- edje_object_signal_callback_del(ctx->bg, "optdetails,hide,done",
+ edje_object_signal_callback_del(ctx->base, "optdetails,hide,done",
"terminology",
_cb_opdt_hide_done);
- edje_object_signal_callback_add(ctx->bg, "optdetails,hide,done",
+ edje_object_signal_callback_add(ctx->base, "optdetails,hide,done",
"terminology",
_cb_opdt_hide_done2, ctx);
elm_object_focus_set(ctx->frame, EINA_FALSE);
@@ -146,8 +147,8 @@ options_hide(Options_Ctx *ctx)
evas_object_del(ctx->over);
ctx->over = NULL;
- edje_object_signal_emit(ctx->bg, "options,hide", "terminology");
- edje_object_signal_emit(ctx->bg, "optdetails,hide", "terminology");
+ edje_object_signal_emit(ctx->base, "options,hide", "terminology");
+ edje_object_signal_emit(ctx->base, "optdetails,hide", "terminology");
if (ctx->donecb)
ctx->donecb(ctx->donedata);
@@ -166,7 +167,7 @@ _cb_mouse_down(void *data,
void
-options_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
+options_show(Evas_Object *win, Evas_Object *base, Evas_Object *bg, Evas_Object *term,
void (*donecb) (void *data), void *donedata)
{
Evas_Object *o, *op_box, *op_tbox;
@@ -182,6 +183,7 @@ options_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
assert(ctx);
ctx->mode = OPTION_NONE;
ctx->win = win;
+ ctx->base = base;
ctx->bg = bg;
ctx->term = term;
ctx->donecb = donecb;
@@ -194,7 +196,7 @@ options_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
ctx->opbox = o = elm_box_add(win);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- edje_object_part_swallow(ctx->bg, "terminology.optdetails", o);
+ edje_object_part_swallow(ctx->base, "terminology.optdetails", o);
evas_object_show(o);
ctx->frame = o = elm_frame_add(win);
@@ -254,19 +256,19 @@ options_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
evas_object_show(o);
evas_object_smart_callback_add(o, "changed", _cb_op_tmp_chg, ctx);
- edje_object_part_swallow(bg, "terminology.options", ctx->frame);
+ edje_object_part_swallow(base, "terminology.options", ctx->frame);
evas_object_show(ctx->frame);
- edje_object_signal_callback_add(ctx->bg, "optdetails,hide,done",
+ edje_object_signal_callback_add(ctx->base, "optdetails,hide,done",
"terminology",
_cb_opdt_hide_done, ctx);
ctx->over = o = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(o, 0, 0, 0, 0);
- edje_object_part_swallow(ctx->bg, "terminology.dismiss", o);
+ edje_object_part_swallow(ctx->base, "terminology.dismiss", o);
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
_cb_mouse_down, ctx);
- edje_object_signal_emit(ctx->bg, "options,show", "terminology");
+ edje_object_signal_emit(ctx->base, "options,show", "terminology");
elm_object_focus_set(ctx->toolbar, EINA_TRUE);
}