rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=db43e081d0886adce4b220945a486e8d928d41d6
commit db43e081d0886adce4b220945a486e8d928d41d6 Author: Andrii Kroitor <[email protected]> Date: Mon Mar 28 17:10:53 2016 +0300 workspace: add show all/hide all parts shortcut (shift+h) --- src/bin/common/signals.h | 1 + src/bin/ui/shortcuts/shortcuts.c | 3 +++ src/bin/ui/shortcuts/shortcuts.h | 1 + src/bin/ui/tabs.c | 10 ++++++++++ src/bin/ui/workspace/group_navigator.c | 16 ++++++++++++++++ src/bin/ui/workspace/group_navigator.h | 3 +++ src/bin/ui/workspace/workspace.c | 8 ++++++++ src/bin/ui/workspace/workspace.h | 4 ++++ 8 files changed, 46 insertions(+) diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h index 320b58e..b87c9cb 100644 --- a/src/bin/common/signals.h +++ b/src/bin/common/signals.h @@ -469,6 +469,7 @@ typedef struct { #define SIGNAL_SHORTCUT_MODE_DEMO "SIGNAL_SHORTCUT_MODE_DEMO" #define SIGNAL_SHORTCUT_STATE_NEXT "SIGNAL_SHORTCUT_STATE_NEXT" #define SIGNAL_SHORTCUT_PART_SHOWHIDE "SIGNAL_SHORTCUT_PART_SHOWHIDE" +#define SIGNAL_SHORTCUT_ALL_PARTS_SHOWHIDE "SIGNAL_SHORTCUT_ALL_PARTS_SHOWHIDE" #define SIGNAL_SHORTCUT_ZOOM_IN "SIGNAL_SHORTCUT_ZOOM_IN" #define SIGNAL_SHORTCUT_ZOOM_OUT "SIGNAL_SHORTCUT_ZOOM_OUT" #define SIGNAL_SHORTCUT_ZOOM_RESET "SIGNAL_SHORTCUT_ZOOM_RESET" diff --git a/src/bin/ui/shortcuts/shortcuts.c b/src/bin/ui/shortcuts/shortcuts.c index 850911b..578b457 100644 --- a/src/bin/ui/shortcuts/shortcuts.c +++ b/src/bin/ui/shortcuts/shortcuts.c @@ -149,6 +149,7 @@ _shortcut_handle(Shortcut_Type type) SHORTCUT(DEL); SHORTCUT(STATE_NEXT); SHORTCUT(PART_SHOWHIDE); + SHORTCUT(ALL_PARTS_SHOWHIDE); SHORTCUT_NUM(TAB_NUM1, SIGNAL_SHORTCUT_TAB_NUM, 1); SHORTCUT_NUM(TAB_NUM2, SIGNAL_SHORTCUT_TAB_NUM, 2); SHORTCUT_NUM(TAB_NUM3, SIGNAL_SHORTCUT_TAB_NUM, 3); @@ -393,6 +394,8 @@ _default_shortcuts_add() MOD_NONE, 39/*s*/); _add_shortcut(SHORTCUT_TYPE_PART_SHOWHIDE, SHORTCUT_TYPE_NONE, MOD_NONE, 43/*h*/); + _add_shortcut(SHORTCUT_TYPE_ALL_PARTS_SHOWHIDE, SHORTCUT_TYPE_NONE, + MOD_SHIFT, 43/*h*/); _add_shortcut(SHORTCUT_TYPE_TAB_NUM1, SHORTCUT_TYPE_NONE, MOD_CTRL, 10/*1*/); diff --git a/src/bin/ui/shortcuts/shortcuts.h b/src/bin/ui/shortcuts/shortcuts.h index 1629a4a..a3a09a7 100644 --- a/src/bin/ui/shortcuts/shortcuts.h +++ b/src/bin/ui/shortcuts/shortcuts.h @@ -86,6 +86,7 @@ typedef enum { SHORTCUT_TYPE_MODE_DEMO, SHORTCUT_TYPE_STATE_NEXT, SHORTCUT_TYPE_PART_SHOWHIDE, + SHORTCUT_TYPE_ALL_PARTS_SHOWHIDE, SHORTCUT_TYPE_ZOOM_IN, SHORTCUT_TYPE_ZOOM_OUT, SHORTCUT_TYPE_ZOOM_RESET, diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c index 6d15911..8805e14 100644 --- a/src/bin/ui/tabs.c +++ b/src/bin/ui/tabs.c @@ -629,6 +629,15 @@ _shortcut_part_showhide_cb(void *data __UNUSED__, } static void +_shortcut_all_parts_showhide_cb(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) +{ + if (tabs.current_workspace) + workspace_all_parts_showhide_request(tabs.current_workspace); +} + +static void _shortcut_tab_next_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) @@ -886,6 +895,7 @@ tabs_add(void) evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_DEL, _shortcut_del_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_STATE_NEXT, _shortcut_state_next_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_PART_SHOWHIDE, _shortcut_part_showhide_cb, NULL); + evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_ALL_PARTS_SHOWHIDE, _shortcut_all_parts_showhide_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_TAB_NEXT, _shortcut_tab_next_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_TAB_PREV, _shortcut_tab_prev_cb, NULL); evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_TAB_NUM, _shortcut_tab_num_cb, NULL); diff --git a/src/bin/ui/workspace/group_navigator.c b/src/bin/ui/workspace/group_navigator.c index fc90fff..45c17de 100644 --- a/src/bin/ui/workspace/group_navigator.c +++ b/src/bin/ui/workspace/group_navigator.c @@ -2107,6 +2107,8 @@ group_navigator_part_showhide_request(Evas_Object *obj) Part_List *pl = evas_object_data_get(obj, GROUP_NAVIGATOR_DATA); Part *part; + assert(pl != NULL); + if (pl->selected_part_item != NULL) { part = elm_object_item_data_get(pl->selected_part_item); @@ -2116,3 +2118,17 @@ group_navigator_part_showhide_request(Evas_Object *obj) } } } + +void +group_navigator_all_parts_showhide_request(Evas_Object *obj) +{ + Evas_Object *eye; + Part_List *pl = evas_object_data_get(obj, GROUP_NAVIGATOR_DATA); + + assert(pl != NULL); + + _on_parts_eye_clicked(NULL, obj, NULL); + eye = elm_object_item_part_content_get(pl->parts_caption_item, "elm.swallow.icon"); + if (eye) + elm_check_state_set(eye, _all_parts_visible(pl)); +} diff --git a/src/bin/ui/workspace/group_navigator.h b/src/bin/ui/workspace/group_navigator.h index 05a4600..0b04b02 100644 --- a/src/bin/ui/workspace/group_navigator.h +++ b/src/bin/ui/workspace/group_navigator.h @@ -119,4 +119,7 @@ group_navigator_state_next_request(Evas_Object *obj); void group_navigator_part_showhide_request(Evas_Object *obj); + +void +group_navigator_all_parts_showhide_request(Evas_Object *obj); #endif /* GROUP_NAVIGATOR_H */ diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c index 460cb57..a42f0f6 100644 --- a/src/bin/ui/workspace/workspace.c +++ b/src/bin/ui/workspace/workspace.c @@ -1194,3 +1194,11 @@ workspace_part_showhide_request(Evas_Object *obj) group_navigator_part_showhide_request(wd->group_navi); } + +void +workspace_all_parts_showhide_request(Evas_Object *obj) +{ + WS_DATA_GET(obj); + + group_navigator_all_parts_showhide_request(wd->group_navi); +} diff --git a/src/bin/ui/workspace/workspace.h b/src/bin/ui/workspace/workspace.h index 75c7d12..4783c6f 100644 --- a/src/bin/ui/workspace/workspace.h +++ b/src/bin/ui/workspace/workspace.h @@ -354,4 +354,8 @@ workspace_state_next_request(Evas_Object *obj); void workspace_part_showhide_request(Evas_Object *obj); + +void +workspace_all_parts_showhide_request(Evas_Object *obj); + #endif /* WORKSPACE_H */ --
