From 66bda10fd8971ad86ed6a61915b2ca7ecc8b7760 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Sun, 21 Jul 2013 16:10:00 +0900 Subject: [PATCH] enventor - added shortcut F1 for readme --- README | 1 + include/menu.h | 2 +- src/main.c | 6 ++++++ src/menu.c | 22 ++++++++++++++++++++-- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README b/README index a0d9f01..acb05a2 100644 --- a/README +++ b/README @@ -39,6 +39,7 @@ Short Cut Keys: -------------------------------------------------------------------------------- Esc = Open/Close Menu +F1 = Show README F5 = Show/Hide Line Number F6 = Show/Hide Status Ctrl+S = Save / Compile EDC diff --git a/include/menu.h b/include/menu.h index 9ccf4db..3c611d3 100644 --- a/include/menu.h +++ b/include/menu.h @@ -4,5 +4,5 @@ Eina_Bool menu_option_toggle(); void menu_ctxpopup_register(Evas_Object *ctxpopup); Eina_Bool menu_edc_load(menu_data *md); void menu_exit(menu_data *md); - +Eina_Bool menu_help(menu_data *md); diff --git a/src/main.c b/src/main.c index 0077643..a729854 100644 --- a/src/main.c +++ b/src/main.c @@ -255,6 +255,12 @@ main_key_down_cb(void *data, int type EINA_UNUSED, void *ev) { ad->ctrl_pressed = EINA_TRUE; } + //README + else if (!strcmp(event->keyname, "F1")) + { + ad->menu_opened = menu_help(ad->md); + return ECORE_CALLBACK_DONE; + } //Line Number else if (!strcmp(event->keyname, "F5")) { diff --git a/src/menu.c b/src/menu.c index b953423..271a597 100644 --- a/src/menu.c +++ b/src/menu.c @@ -93,8 +93,8 @@ setting_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED, const char *source EINA_UNUSED) { menu_data *md = data; - evas_object_del(md->help_layout); - md->help_layout = NULL; + evas_object_del(md->setting_layout); + md->setting_layout = NULL; elm_object_disabled_set(md->menu_layout, EINA_FALSE); elm_object_focus_set(md->menu_layout, EINA_TRUE); } @@ -445,8 +445,11 @@ help_open(menu_data *md) elm_object_style_set(entry, elm_app_name_get()); elm_entry_scrollable_set(entry, EINA_TRUE); elm_entry_line_wrap_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, EINA_FALSE); evas_object_show(entry); + elm_object_focus_set(entry, EINA_TRUE); + elm_object_part_content_set(layout, "elm.swallow.entry", entry); elm_entry_entry_append(entry, ""); @@ -705,6 +708,13 @@ load_save_btn_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, warning_close(md); } +Eina_Bool +menu_help(menu_data *md) +{ + help_open(md); + return EINA_TRUE; +} + Eina_Bool menu_edc_load(menu_data *md) { @@ -826,6 +836,14 @@ menu_option_toggle() return EINA_TRUE; } } + else + { + if (md->help_layout) + { + help_close(md); + return EINA_FALSE; + } + } //Ctxpopup if (md->ctxpopup)