hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=d929258e573a3d42e9ac611fa0fc22bdc6aa0aed

commit d929258e573a3d42e9ac611fa0fc22bdc6aa0aed
Author: taehyub <taehyub....@samsung.com>
Date:   Fri Feb 19 02:26:15 2016 +0900

    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
---
 data/themes/default/layout_common.edc | 24 ++++++++++++++++++++
 src/bin/menu.c                        | 42 +++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/data/themes/default/layout_common.edc 
b/data/themes/default/layout_common.edc
index b6c9037..f9f5aea 100644
--- a/data/themes/default/layout_common.edc
+++ b/data/themes/default/layout_common.edc
@@ -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;
diff --git a/src/bin/menu.c b/src/bin/menu.c
index 5cc8dfa..b1cb2c9 100644
--- a/src/bin/menu.c
+++ b/src/bin/menu.c
@@ -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;
 

-- 


Reply via email to