aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/options.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-09-02 14:10:31 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-09-02 14:10:31 +0000
commita24f4ba16decc0f5e27c88996f73973cef4d0cae (patch)
tree7b8d102f2d5c818a8a434e234e3160a0654902ee /src/bin/options.c
parentand up ver to 1.7.99 now in svn. nack to svnrev num at end. (diff)
downloadterminology-a24f4ba16decc0f5e27c88996f73973cef4d0cae.tar.gz
split options inot more swallows in the terminology theme because this
is eventually how it needs to work as i wanted wallpaper and theme stuff to totally see the terminology txt/bg like wp2 in e17. :) SVN revision: 75941
Diffstat (limited to 'src/bin/options.c')
-rw-r--r--src/bin/options.c67
1 files changed, 43 insertions, 24 deletions
diff --git a/src/bin/options.c b/src/bin/options.c
index 1515bfd..89df426 100644
--- a/src/bin/options.c
+++ b/src/bin/options.c
@@ -25,66 +25,56 @@ static void
_cb_op_font(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 1) return;
- elm_box_clear(op_opbox);
- options_font(op_opbox, data);
mode = 1;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
_cb_op_theme(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 2) return;
- elm_box_clear(op_opbox);
- options_theme(op_opbox, data);
- // XXX: not done yet
mode = 2;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
_cb_op_wallpaper(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 3) return;
- elm_box_clear(op_opbox);
- options_wallpaper(op_opbox, data);
- // XXX: not done yet
mode = 3;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
_cb_op_colors(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 4) return;
- elm_box_clear(op_opbox);
- options_colors(op_opbox, data);
- // XXX: not done yet
mode = 4;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
_cb_op_video(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 5) return;
- elm_box_clear(op_opbox);
- options_video(op_opbox, data);
mode = 5;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
_cb_op_behavior(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 6) return;
- elm_box_clear(op_opbox);
- options_behavior(op_opbox, data);
mode = 6;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
_cb_op_helpers(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 7) return;
- elm_box_clear(op_opbox);
- options_helpers(op_opbox, data);
mode = 7;
+ edje_object_signal_emit(saved_bg, "optdetails,hide", "terminology");
}
static void
@@ -97,8 +87,10 @@ _cb_op_tmp_chg(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
static Eina_Bool
_cb_op_del_delay(void *data __UNUSED__)
{
+ evas_object_del(op_opbox);
evas_object_del(op_frame);
options_font_clear();
+ op_opbox = NULL;
op_frame = NULL;
op_del_timer = NULL;
elm_cache_all_flush();
@@ -111,6 +103,24 @@ _cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
options_toggle(saved_win, saved_bg, data);
}
+static void
+_cb_opdt_hide_done(void *data, Evas_Object *obj __UNUSED__, const char *sig, const char *src)
+{
+ elm_box_clear(op_opbox);
+ switch (mode)
+ {
+ case 1: options_font(op_opbox, data); break;
+ case 2: options_theme(op_opbox, data); break;
+ case 3: options_wallpaper(op_opbox, data); break;
+ case 4: options_colors(op_opbox, data); break;
+ case 5: options_video(op_opbox, data); break;
+ case 6: options_behavior(op_opbox, data); break;
+ case 7: options_helpers(op_opbox, data); break;
+ default: break;
+ }
+ edje_object_signal_emit(saved_bg, "optdetails,show", "terminology");
+}
+
void
options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
{
@@ -124,6 +134,12 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
Elm_Object_Item *it_fn;
Config *config = termio_config_get(term);
+ op_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(bg, "terminology.optdetails", o);
+ evas_object_show(o);
+
op_frame = o = elm_frame_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);
@@ -134,12 +150,6 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
elm_object_content_set(op_frame, o);
evas_object_show(o);
- op_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);
- elm_box_pack_end(op_box, o);
- evas_object_show(o);
-
op_tbox = o = elm_box_add(win);
evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, 1.0, EVAS_HINT_FILL);
@@ -183,8 +193,14 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
edje_object_part_swallow(bg, "terminology.options", op_frame);
evas_object_show(op_frame);
}
+ else if ((op_opbox) && (!op_out))
+ edje_object_signal_emit(bg, "optdetails,show", "terminology");
+
if (!op_out)
{
+ edje_object_signal_callback_add(bg, "optdetails,hide,done",
+ "terminology",
+ _cb_opdt_hide_done, term);
op_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(o, 0, 0, 0, 0);
edje_object_part_swallow(bg, "terminology.dismiss", o);
@@ -203,10 +219,13 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
}
else
{
+ edje_object_signal_callback_del(bg, "optdetails,hide,done",
+ "terminology",
+ _cb_opdt_hide_done);
evas_object_del(op_over);
op_over = NULL;
-
edje_object_signal_emit(bg, "options,hide", "terminology");
+ edje_object_signal_emit(bg, "optdetails,hide", "terminology");
op_out = EINA_FALSE;
elm_object_focus_set(op_frame, EINA_FALSE);
elm_object_focus_set(term, EINA_TRUE);