add back button in menu and about screen

Summary:
Summary
There is no back button in menu and about screens.
So user cannot close the screens without 'escape key'.
To make more efficient I added back button on the screens.

Test Plan:
1. press 'esc' key
2. see the back button on the screen
3. prees 'F2' key
4. see the back button on the screen

Reviewers: Jaehyun_Cho, NikaWhite, Hermet

Differential Revision: https://phab.enlightenment.org/D3705
This commit is contained in:
taehyub 2016-02-19 02:26:15 +09:00 committed by Hermet Park
parent 33b1f74e48
commit d929258e57
2 changed files with 66 additions and 0 deletions

View File

@ -60,6 +60,18 @@ group { name: "about_layout";
rel2.relative: 0 0;
}
}
part { name: "elm.swallow.back_button";
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
min: 26 26;
max: 26 26;
rel1.offset: 0 10;
rel2.offset: -37 -1;
align: 1 0.0;
}
}
part { name: "event_blocker";
type: RECT;
description { state: "default" 0.0;
@ -930,6 +942,18 @@ group { name: "menu_layout";
align: 1 1;
}
}
part { name: "elm.swallow.back_button";
type: SWALLOW;
scale: 1;
description { state: "default" 0.0;
fixed: 1 1;
min: 26 26;
max: 26 26;
rel1.offset: 0 10;
rel2.offset: -37 -1;
align: 1 0.0;
}
}
part { name: "event_blocker";
type: RECT;
description { state: "default" 0.0;

View File

@ -137,6 +137,22 @@ newfile_cancel_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
newfile_close(md);
}
static void
about_close_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *envent_info EINA_UNUSED)
{
menu_data *md = data;
about_close(md);
}
static void
menu_close_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *envent_info EINA_UNUSED)
{
menu_data *md = data;
menu_close(md);
}
void
newfile_open(menu_data *md)
{
@ -229,6 +245,19 @@ about_open(menu_data *md)
evas_object_show(layout);
base_win_resize_object_add(layout);
//Back Button
Evas_Object *back_button = elm_button_add(layout);
elm_object_focus_allow_set(back_button, EINA_FALSE);
evas_object_show(back_button);
evas_object_smart_callback_add(back_button, "clicked", about_close_cb, md);
//back button image can be changed to another one
Evas_Object *back_img = elm_image_add(back_button);
elm_image_file_set(back_img, EDJE_PATH, "undo");
elm_object_content_set(back_button, back_img);
elm_object_part_content_set(layout, "elm.swallow.back_button", back_button);
//Entry
Evas_Object *entry = elm_entry_add(layout);
elm_object_style_set(entry, "about");
@ -607,6 +636,19 @@ menu_open(menu_data *md)
evas_object_show(layout);
base_win_resize_object_add(layout);
//Back Button
Evas_Object *back_button = elm_button_add(layout);
elm_object_focus_allow_set(back_button, EINA_FALSE);
evas_object_show(back_button);
evas_object_smart_callback_add(back_button, "clicked", menu_close_cb, md);
//back button image can be changed to another one
Evas_Object *back_img = elm_image_add(back_button);
elm_image_file_set(back_img, EDJE_PATH, "undo");
elm_object_content_set(back_button, back_img);
elm_object_part_content_set(layout, "elm.swallow.back_button", back_button);
//Button
Evas_Object *btn;