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
This commit is contained in:
Carsten Haitzler 2012-09-02 14:10:31 +00:00
parent 2809210fab
commit a24f4ba16d
6 changed files with 157 additions and 44 deletions

View File

@ -744,7 +744,7 @@ collections {
////////////////////////////////////////////////////////////////////
// overlayed options and controls
part { name: "terminology.options"; type: SWALLOW;
part { name: "terminology.optdetails"; type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
@ -767,6 +767,54 @@ collections {
align: 1.0 0.5;
rel1 {
relative: 0.25 0.02;
offset: 8 8;
}
rel2 {
to_x: "terminology.options";
relative: 0.0 0.98;
offset: -9 -9;
}
}
}
program { name: "opdt_show";
signal: "optdetails,show";
source: "terminology";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.4;
target: "terminology.optdetails";
}
program { name: "opdt_hide";
signal: "optdetails,hide";
source: "terminology";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.2;
target: "terminology.optdetails";
after: "opdt_hide2";
}
program { name: "opdt_hide2";
action: SIGNAL_EMIT "optdetails,hide,done" "terminology";
}
part { name: "terminology.options"; type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
align: 0.0 0.5;
visible: 0;
rel1 {
relative: 1.0 0.02;
offset: 8 8;
}
rel2 {
relative: 1.0 0.98;
offset: 8 -9;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
align: 1.0 0.5;
rel1 {
offset: -9 8;
}
rel2 {

View File

@ -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);

View File

@ -104,14 +104,21 @@ void
options_behavior(Evas_Object *opbox, Evas_Object *term)
{
Config *config = termio_config_get(term);
Evas_Object *o, *bx, *sc;
Evas_Object *o, *bx, *sc, *fr;
char *txt;
fr = o = elm_frame_add(opbox);
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_object_text_set(o, "Behavior");
elm_box_pack_end(opbox, o);
evas_object_show(o);
sc = o = elm_scroller_add(opbox);
elm_scroller_content_min_limit(sc, EINA_TRUE, EINA_FALSE);
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(opbox, o);
elm_object_content_set(fr, o);
evas_object_show(o);
bx = o = elm_box_add(opbox);

View File

@ -215,7 +215,7 @@ options_font_clear(void)
void
options_font(Evas_Object *opbox, Evas_Object *term)
{
Evas_Object *o, *bx;
Evas_Object *o, *bx, *fr, *bx0;
char buf[4096], *file, *fname, *s;
Eina_List *files, *fontlist, *l;
Font *f;
@ -225,6 +225,19 @@ options_font(Evas_Object *opbox, Evas_Object *term)
options_font_clear();
fr = o = elm_frame_add(opbox);
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_object_text_set(o, "Font");
elm_box_pack_end(opbox, o);
evas_object_show(o);
bx0 = o = elm_box_add(opbox);
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_object_content_set(fr, o);
evas_object_show(o);
bx = o = elm_box_add(opbox);
elm_box_horizontal_set(o, EINA_TRUE);
@ -252,7 +265,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
elm_box_pack_end(bx, o);
evas_object_show(o);
elm_box_pack_end(opbox, bx);
elm_box_pack_end(bx0, bx);
evas_object_show(bx);
it_class = elm_genlist_item_class_new();
@ -351,7 +364,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
elm_genlist_item_class_free(it_class);
elm_genlist_item_class_free(it_group);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_size_hint_weight_set(opbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(opbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);

View File

@ -167,15 +167,28 @@ void
options_helpers(Evas_Object *opbox, Evas_Object *term)
{
Config *config = termio_config_get(term);
Evas_Object *o, *bx, *sc;
Evas_Object *o, *bx, *sc, *fr, *bx0;
char *txt;
fr = o = elm_frame_add(opbox);
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_object_text_set(o, "Helpers");
elm_box_pack_end(opbox, o);
evas_object_show(o);
bx0 = o = elm_box_add(opbox);
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_object_content_set(fr, o);
evas_object_show(o);
o = elm_check_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Inline if possible");
elm_check_state_set(o, config->helper.inline_please);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_helper_inline_chg, term);
@ -184,14 +197,14 @@ options_helpers(Evas_Object *opbox, Evas_Object *term)
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_separator_horizontal_set(o, EINA_TRUE);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
sc = o = elm_scroller_add(opbox);
elm_scroller_content_min_limit(sc, EINA_TRUE, EINA_FALSE);
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(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
bx = o = elm_box_add(opbox);

View File

@ -44,15 +44,28 @@ _cb_op_video_vidmod_chg(void *data, Evas_Object *obj, void *event __UNUSED__)
void
options_video(Evas_Object *opbox, Evas_Object *term)
{
Evas_Object *o;
Evas_Object *o, *fr, *bx0;
Config *config = termio_config_get(term);
fr = o = elm_frame_add(opbox);
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_object_text_set(o, "Video");
elm_box_pack_end(opbox, o);
evas_object_show(o);
bx0 = o = elm_box_add(opbox);
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_object_content_set(fr, o);
evas_object_show(o);
op_trans = o = elm_check_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Translucent");
elm_check_state_set(o, config->translucent);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_video_trans_chg, term);
@ -61,7 +74,7 @@ options_video(Evas_Object *opbox, Evas_Object *term)
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_separator_horizontal_set(o, EINA_TRUE);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
op_mute = o = elm_check_add(opbox);
@ -69,7 +82,7 @@ options_video(Evas_Object *opbox, Evas_Object *term)
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Audio muted");
elm_check_state_set(o, config->mute);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_video_mute_chg, term);
@ -77,14 +90,14 @@ options_video(Evas_Object *opbox, Evas_Object *term)
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_separator_horizontal_set(o, EINA_TRUE);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
o = elm_label_add(opbox);
evas_object_size_hint_weight_set(o, 0.0, 0.0);
evas_object_size_hint_align_set(o, 0.0, 0.5);
elm_object_text_set(o, "Video Engine:");
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
op_vidmod = o = elm_radio_add(opbox);
@ -92,7 +105,7 @@ options_video(Evas_Object *opbox, Evas_Object *term)
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Automatic");
elm_radio_state_value_set(o, 0);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_video_vidmod_chg, term);
@ -103,7 +116,7 @@ options_video(Evas_Object *opbox, Evas_Object *term)
elm_object_text_set(o, "Gstreamer");
elm_radio_state_value_set(o, 1);
elm_radio_group_add(o, op_vidmod);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_video_vidmod_chg, term);
@ -114,7 +127,7 @@ options_video(Evas_Object *opbox, Evas_Object *term)
elm_object_text_set(o, "Xine");
elm_radio_state_value_set(o, 2);
elm_radio_group_add(o, op_vidmod);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_video_vidmod_chg, term);
@ -125,7 +138,7 @@ options_video(Evas_Object *opbox, Evas_Object *term)
elm_object_text_set(o, "Generic (VLC)");
elm_radio_state_value_set(o, 3);
elm_radio_group_add(o, op_vidmod);
elm_box_pack_end(opbox, o);
elm_box_pack_end(bx0, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_video_vidmod_chg, term);