rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=ec2afdad501f0d26b7a17a33555264893172e491

commit ec2afdad501f0d26b7a17a33555264893172e491
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Fri Mar 25 11:25:40 2016 +0200

    workspace: add shortcut to cycle states of selected part (s)
---
 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 | 30 ++++++++++++++++++++++++++++++
 src/bin/ui/workspace/group_navigator.h |  2 ++
 src/bin/ui/workspace/workspace.c       |  8 ++++++++
 src/bin/ui/workspace/workspace.h       |  3 +++
 8 files changed, 58 insertions(+)

diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h
index debed69..ef10340 100644
--- a/src/bin/common/signals.h
+++ b/src/bin/common/signals.h
@@ -467,6 +467,7 @@ typedef struct {
 #define SIGNAL_SHORTCUT_MODE_NORMAL "SIGNAL_SHORTCUT_MODE_NORMAL"
 #define SIGNAL_SHORTCUT_MODE_CODE "SIGNAL_SHORTCUT_MODE_CODE"
 #define SIGNAL_SHORTCUT_MODE_DEMO "SIGNAL_SHORTCUT_MODE_DEMO"
+#define SIGNAL_SHORTCUT_STATE_NEXT "SIGNAL_SHORTCUT_STATE_NEXT"
 /**
  * emited when shortcut is pressed.
  * eventinfo - tab number.
diff --git a/src/bin/ui/shortcuts/shortcuts.c b/src/bin/ui/shortcuts/shortcuts.c
index 6480c5a..2ed7a90 100644
--- a/src/bin/ui/shortcuts/shortcuts.c
+++ b/src/bin/ui/shortcuts/shortcuts.c
@@ -145,6 +145,7 @@ _shortcut_handle(Shortcut_Type type)
         SHORTCUT(ADD_ITEM);
         SHORTCUT(ADD_PROGRAM);
         SHORTCUT(DEL);
+        SHORTCUT(STATE_NEXT);
         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);
@@ -366,6 +367,8 @@ _default_shortcuts_add()
                  MOD_NONE, 27/*r*/);
    _add_shortcut(SHORTCUT_TYPE_DEL, SHORTCUT_TYPE_NONE,
                  MOD_NONE, 119/*del*/);
+   _add_shortcut(SHORTCUT_TYPE_STATE_NEXT, SHORTCUT_TYPE_NONE,
+                 MOD_NONE, 39/*s*/);
 
    _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 2aa5ce2..3c488dd 100644
--- a/src/bin/ui/shortcuts/shortcuts.h
+++ b/src/bin/ui/shortcuts/shortcuts.h
@@ -84,6 +84,7 @@ typedef enum {
    SHORTCUT_TYPE_MODE_NORMAL,
    SHORTCUT_TYPE_MODE_CODE,
    SHORTCUT_TYPE_MODE_DEMO,
+   SHORTCUT_TYPE_STATE_NEXT,
 
    SHORTCUT_TYPE_LAST,
 } Shortcut_Type;
diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c
index d1ddb44..adbac60 100644
--- a/src/bin/ui/tabs.c
+++ b/src/bin/ui/tabs.c
@@ -611,6 +611,15 @@ _shortcut_del_cb(void *data __UNUSED__,
 }
 
 static void
+_shortcut_state_next_cb(void *data __UNUSED__,
+                        Evas_Object *obj __UNUSED__,
+                        void *event_info __UNUSED__)
+{
+   if (tabs.current_workspace)
+     workspace_state_next_request(tabs.current_workspace);
+}
+
+static void
 _shortcut_tab_next_cb(void *data __UNUSED__,
                       Evas_Object *obj __UNUSED__,
                       void *event_info __UNUSED__)
@@ -829,6 +838,7 @@ tabs_add(void)
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_ADD_STATE, 
_shortcut_add_state_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_ADD_PROGRAM, 
_shortcut_add_program_cb, NULL);
    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_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 ad91f35..9b253da 100644
--- a/src/bin/ui/workspace/group_navigator.c
+++ b/src/bin/ui/workspace/group_navigator.c
@@ -1983,3 +1983,33 @@ group_navigator_delete_request(Evas_Object *obj)
    if (!elm_object_disabled_get(pl->btn_del))
      _on_btn_minus_clicked(pl, NULL, NULL);
 }
+
+void
+group_navigator_state_next_request(Evas_Object *obj)
+{
+   Part_List *pl = evas_object_data_get(obj, GROUP_NAVIGATOR_DATA);
+   Part *part;
+   State *state;
+   Eina_List *l;
+
+   if (pl->selected_part_item != NULL)
+     {
+        part = elm_object_item_data_get(pl->selected_part_item);
+        if (eina_list_count(part->states) > 1)
+          {
+             l = eina_list_data_find_list(part->states, part->current_state);
+
+             assert(l != NULL);
+
+             if (eina_list_next(l) != NULL)
+               state = eina_list_data_get(eina_list_next(l));
+             else
+               state = eina_list_data_get(part->states);
+
+             editor_part_selected_state_set(pl->group->edit_object, NULL, 
false,
+                                            state->part->name,
+                                            state->parsed_name,
+                                            state->parsed_val);
+          }
+     }
+}
diff --git a/src/bin/ui/workspace/group_navigator.h 
b/src/bin/ui/workspace/group_navigator.h
index b211af1..f032924 100644
--- a/src/bin/ui/workspace/group_navigator.h
+++ b/src/bin/ui/workspace/group_navigator.h
@@ -114,4 +114,6 @@ group_navigator_add_program_request(Evas_Object *obj);
 void
 group_navigator_delete_request(Evas_Object *obj);
 
+void
+group_navigator_state_next_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 f3e0d01..7661eb8 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -1181,3 +1181,11 @@ workspace_zoom_factor_get(Evas_Object *obj)
 
    return wd->zoom_factor;
 }
+
+void
+workspace_state_next_request(Evas_Object *obj)
+{
+   WS_DATA_GET(obj);
+
+   group_navigator_state_next_request(wd->group_navi);
+}
diff --git a/src/bin/ui/workspace/workspace.h b/src/bin/ui/workspace/workspace.h
index 8e8550f..0cee836 100644
--- a/src/bin/ui/workspace/workspace.h
+++ b/src/bin/ui/workspace/workspace.h
@@ -348,4 +348,7 @@ workspace_delete_request(Evas_Object *obj);
 
 void
 workspace_mode_set(Evas_Object *obj, Workspace_Mode mode);
+
+void
+workspace_state_next_request(Evas_Object *obj);
 #endif /* WORKSPACE_H */

-- 


Reply via email to