summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/default/base.src.in6
-rw-r--r--config/mobile/base.src.in6
-rw-r--r--config/standard/base.src.in6
-rw-r--r--src/lib/elementary/elm_color_item.eo2
-rw-r--r--src/lib/elementary/elm_colorselector.c100
-rw-r--r--src/lib/elementary/elm_colorselector.eo1
-rw-r--r--src/lib/elementary/elm_widget_colorselector.h4
7 files changed, 110 insertions, 15 deletions
diff --git a/config/default/base.src.in b/config/default/base.src.in
index 9e05df6e19..90188f3827 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -803,6 +803,12 @@ group "Elm_Config" struct {
803 value "action" string: "move"; 803 value "action" string: "move";
804 value "params" string: "down"; 804 value "params" string: "down";
805 } 805 }
806 group "Elm_Config_Binding_Key" struct {
807 value "context" int: 0;
808 value "key" string: "Return";
809 value "action" string: "activate";
810 value "params" string: "";
811 }
806 } 812 }
807 } 813 }
808 group "Elm_Config_Bindings_Widget" struct { 814 group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index 56c4f3fbf3..5619970c93 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -807,6 +807,12 @@ group "Elm_Config" struct {
807 value "action" string: "move"; 807 value "action" string: "move";
808 value "params" string: "down"; 808 value "params" string: "down";
809 } 809 }
810 group "Elm_Config_Binding_Key" struct {
811 value "context" int: 0;
812 value "key" string: "Return";
813 value "action" string: "activate";
814 value "params" string: "";
815 }
810 } 816 }
811 } 817 }
812 group "Elm_Config_Bindings_Widget" struct { 818 group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index e628f8274d..849185f6e5 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -804,6 +804,12 @@ group "Elm_Config" struct {
804 value "action" string: "move"; 804 value "action" string: "move";
805 value "params" string: "down"; 805 value "params" string: "down";
806 } 806 }
807 group "Elm_Config_Binding_Key" struct {
808 value "context" int: 0;
809 value "key" string: "Return";
810 value "action" string: "activate";
811 value "params" string: "";
812 }
807 } 813 }
808 } 814 }
809 group "Elm_Config_Bindings_Widget" struct { 815 group "Elm_Config_Bindings_Widget" struct {
diff --git a/src/lib/elementary/elm_color_item.eo b/src/lib/elementary/elm_color_item.eo
index eab8b5416e..00928c379f 100644
--- a/src/lib/elementary/elm_color_item.eo
+++ b/src/lib/elementary/elm_color_item.eo
@@ -40,5 +40,7 @@ class Elm.Color.Item(Elm.Widget.Item)
40 Efl.Object.destructor; 40 Efl.Object.destructor;
41 Elm.Widget.Item.access_register; 41 Elm.Widget.Item.access_register;
42 Elm.Widget.Item.signal_emit; 42 Elm.Widget.Item.signal_emit;
43 Elm.Widget.Item.focus.set;
44 Elm.Widget.Item.focus.get;
43 } 45 }
44} 46}
diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c
index 189d341f87..66af2e211a 100644
--- a/src/lib/elementary/elm_colorselector.c
+++ b/src/lib/elementary/elm_colorselector.c
@@ -183,9 +183,11 @@ static const Elm_Color_Name _color_name[] = {
183}; 183};
184 184
185static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); 185static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
186static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
186 187
187static const Elm_Action key_actions[] = { 188static const Elm_Action key_actions[] = {
188 {"move", _key_action_move}, 189 {"move", _key_action_move},
190 {"activate", _key_action_activate},
189 {NULL, NULL} 191 {NULL, NULL}
190}; 192};
191 193
@@ -237,6 +239,7 @@ _items_del(Elm_Colorselector_Data *sd)
237 239
238 sd->items = NULL; 240 sd->items = NULL;
239 sd->selected = NULL; 241 sd->selected = NULL;
242 sd->focus_items = NULL;
240} 243}
241 244
242static void 245static void
@@ -1895,6 +1898,7 @@ _elm_colorselector_efl_canvas_group_group_add(Eo *obj, Elm_Colorselector_Data *p
1895 priv->focused = ELM_COLORSELECTOR_PALETTE; 1898 priv->focused = ELM_COLORSELECTOR_PALETTE;
1896 priv->sel_color_type = HUE; 1899 priv->sel_color_type = HUE;
1897 priv->selected = NULL; 1900 priv->selected = NULL;
1901 priv->focus_items = NULL;
1898 priv->er = 255; 1902 priv->er = 255;
1899 priv->eg = 0; 1903 priv->eg = 0;
1900 priv->eb = 0; 1904 priv->eb = 0;
@@ -2014,7 +2018,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2014 { 2018 {
2015 if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected) 2019 if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected)
2016 { 2020 {
2017 cl = eina_list_prev(sd->selected); 2021 cl = eina_list_prev(sd->focus_items);
2018 } 2022 }
2019 else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS) 2023 else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
2020 { 2024 {
@@ -2028,7 +2032,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2028 { 2032 {
2029 if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected) 2033 if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected)
2030 { 2034 {
2031 cl = eina_list_next(sd->selected); 2035 cl = eina_list_next(sd->focus_items);
2032 } 2036 }
2033 else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS) 2037 else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
2034 { 2038 {
@@ -2061,16 +2065,16 @@ _key_action_move(Evas_Object *obj, const char *params)
2061 } 2065 }
2062 } 2066 }
2063 else if (sd->focused == ELM_COLORSELECTOR_PALETTE) 2067 else if (sd->focused == ELM_COLORSELECTOR_PALETTE)
2064 { 2068 {
2065 cl = _palette_box_vertical_item_get(sd->selected, PALETTE_BOX_UP); 2069 cl = _palette_box_vertical_item_get(sd->focus_items, PALETTE_BOX_UP);
2066 if (!cl) cl = sd->selected; 2070 if (!cl) cl = sd->focus_items;
2067 } 2071 }
2068 } 2072 }
2069 else if (!strcmp(dir, "down")) 2073 else if (!strcmp(dir, "down"))
2070 { 2074 {
2071 if (sd->focused == ELM_COLORSELECTOR_PALETTE) 2075 if (sd->focused == ELM_COLORSELECTOR_PALETTE)
2072 { 2076 {
2073 cl = _palette_box_vertical_item_get(sd->selected, PALETTE_BOX_DOWN); 2077 cl = _palette_box_vertical_item_get(sd->focus_items, PALETTE_BOX_DOWN);
2074 if (sd->mode == ELM_COLORSELECTOR_BOTH && !cl) 2078 if (sd->mode == ELM_COLORSELECTOR_BOTH && !cl)
2075 { 2079 {
2076 sd->focused = ELM_COLORSELECTOR_COMPONENTS; 2080 sd->focused = ELM_COLORSELECTOR_COMPONENTS;
@@ -2095,20 +2099,30 @@ _key_action_move(Evas_Object *obj, const char *params)
2095 { 2099 {
2096 eo_item = eina_list_data_get(cl); 2100 eo_item = eina_list_data_get(cl);
2097 ELM_COLOR_ITEM_DATA_GET(eo_item, item); 2101 ELM_COLOR_ITEM_DATA_GET(eo_item, item);
2098 elm_object_signal_emit(VIEW(item), "elm,anim,activate", "elm"); 2102 elm_object_item_focus_set(eo_item, EINA_TRUE);
2099 elm_colorselector_color_set
2100 (WIDGET(item), item->color->r, item->color->g, item->color->b,
2101 item->color->a);
2102 efl_event_callback_legacy_call
2103 (WIDGET(item), ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED, eo_item);
2104 elm_obj_color_item_selected_set(eo_item, EINA_TRUE);
2105 } 2103 }
2106 else if (!cl && sd->focused == ELM_COLORSELECTOR_PALETTE) 2104 else if (!cl && (sd->focused == ELM_COLORSELECTOR_PALETTE))
2107 return EINA_FALSE; 2105 return EINA_FALSE;
2106 else if (!cl && (sd->focused == ELM_COLORSELECTOR_COMPONENTS))
2107 _elm_widget_focus_highlight_start(obj);
2108 2108
2109 return EINA_TRUE; 2109 return EINA_TRUE;
2110} 2110}
2111 2111
2112
2113static Eina_Bool
2114_key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
2115{
2116 ELM_COLORSELECTOR_DATA_GET(obj, sd);
2117
2118 if (sd->focused == ELM_COLORSELECTOR_PALETTE)
2119 {
2120 Elm_Object_Item *eo_item = NULL;
2121 eo_item = eina_list_data_get(sd->focus_items);
2122 elm_obj_color_item_selected_set(eo_item, EINA_TRUE);
2123 }
2124}
2125
2112EOLIAN static Eina_Bool 2126EOLIAN static Eina_Bool
2113_elm_colorselector_elm_widget_event(Eo *obj, Elm_Colorselector_Data *sd, Evas_Object *src, Evas_Callback_Type type, void *event_info) 2127_elm_colorselector_elm_widget_event(Eo *obj, Elm_Colorselector_Data *sd, Evas_Object *src, Evas_Callback_Type type, void *event_info)
2114{ 2128{
@@ -2119,6 +2133,7 @@ _elm_colorselector_elm_widget_event(Eo *obj, Elm_Colorselector_Data *sd, Evas_Ob
2119 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; 2133 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
2120 if (!sd) return EINA_FALSE; 2134 if (!sd) return EINA_FALSE;
2121 if (!sd->selected) sd->selected = sd->items; 2135 if (!sd->selected) sd->selected = sd->items;
2136 if (!sd->focus_items) sd->focus_items = sd->items;
2122 2137
2123 if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions)) 2138 if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
2124 return EINA_FALSE; 2139 return EINA_FALSE;
@@ -2219,6 +2234,20 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
2219} 2234}
2220 2235
2221EOLIAN static void 2236EOLIAN static void
2237_elm_colorselector_elm_widget_focus_highlight_geometry_get(const Eo *obj EINA_UNUSED, Elm_Colorselector_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
2238{
2239 if (sd->focused_item && (sd->focused == ELM_COLORSELECTOR_PALETTE))
2240 {
2241 ELM_COLOR_ITEM_DATA_GET(sd->focused_item, focus_it);
2242 evas_object_geometry_get(VIEW(focus_it), x, y, w, h);
2243 }
2244 else if(sd->focused == ELM_COLORSELECTOR_COMPONENTS)
2245 evas_object_geometry_get(sd->cb_data[sd->sel_color_type]->colorbar, x, y, w, h);
2246 else
2247 evas_object_geometry_get(obj, x, y, w, h);
2248}
2249
2250EOLIAN static void
2222_elm_colorselector_elm_widget_access(Eo *obj, Elm_Colorselector_Data *_pd EINA_UNUSED, Eina_Bool acs) 2251_elm_colorselector_elm_widget_access(Eo *obj, Elm_Colorselector_Data *_pd EINA_UNUSED, Eina_Bool acs)
2223{ 2252{
2224 _elm_colorselector_smart_focus_next_enable = acs; 2253 _elm_colorselector_smart_focus_next_enable = acs;
@@ -2491,6 +2520,10 @@ _elm_color_item_selected_set(Eo *eo_item,
2491 2520
2492 EINA_LIST_FOREACH(sd->items, l, eo_temp_item) 2521 EINA_LIST_FOREACH(sd->items, l, eo_temp_item)
2493 if (eo_item == eo_temp_item) sd->selected = l; 2522 if (eo_item == eo_temp_item) sd->selected = l;
2523
2524 elm_object_signal_emit(VIEW(item), "elm,anim,activate", "elm");
2525 efl_event_callback_legacy_call
2526 (WIDGET(item), ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED, eo_item);
2494 } 2527 }
2495} 2528}
2496 2529
@@ -2558,6 +2591,43 @@ _elm_colorselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EIN
2558 return &atspi_actions[0]; 2591 return &atspi_actions[0];
2559} 2592}
2560 2593
2594EOLIAN static void
2595_elm_color_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Color_Item_Data *it, Eina_Bool focused)
2596{
2597 Evas_Object *obj = WIDGET(it);
2598 ELM_COLORSELECTOR_DATA_GET(obj, sd);
2599
2600 if (focused)
2601 {
2602 if (eo_it != sd->focused_item)
2603 sd->focused_item = eo_it;
2604
2605 Eina_List *l;
2606 Eo *eo_temp_item;
2607 EINA_LIST_FOREACH(sd->items, l, eo_temp_item)
2608 if (eo_it == eo_temp_item) sd->focus_items = l;
2609 }
2610 else
2611 {
2612 if (!elm_widget_focus_get(obj))
2613 return;
2614 sd->focused_item = NULL;
2615 }
2616
2617 _elm_widget_focus_highlight_start(obj);
2618}
2619
2620EOLIAN static Eina_Bool
2621_elm_color_item_elm_widget_item_focus_get(Eo *eo_it, Elm_Color_Item_Data *it)
2622{
2623 Evas_Object *obj = WIDGET(it);
2624 ELM_COLORSELECTOR_DATA_GET(obj, sd);
2625
2626 if (eo_it == sd->focused_item)
2627 return EINA_TRUE;
2628 return EINA_FALSE;
2629}
2630
2561#include "elm_colorselector.eo.c" 2631#include "elm_colorselector.eo.c"
2562#include "elm_color_item.eo.c" 2632#include "elm_color_item.eo.c"
2563 2633
diff --git a/src/lib/elementary/elm_colorselector.eo b/src/lib/elementary/elm_colorselector.eo
index 78faf142a8..3563b8e30b 100644
--- a/src/lib/elementary/elm_colorselector.eo
+++ b/src/lib/elementary/elm_colorselector.eo
@@ -114,6 +114,7 @@ selected.]]
114 Elm.Widget.focus_next_manager_is; 114 Elm.Widget.focus_next_manager_is;
115 Elm.Widget.focus_next; 115 Elm.Widget.focus_next;
116 Elm.Widget.focus_direction_manager_is; 116 Elm.Widget.focus_direction_manager_is;
117 Elm.Widget.focus_highlight_geometry_get;
117 Elm.Widget.access; 118 Elm.Widget.access;
118 Elm.Widget.event; 119 Elm.Widget.event;
119 Elm.Layout.sizing_eval; 120 Elm.Layout.sizing_eval;
diff --git a/src/lib/elementary/elm_widget_colorselector.h b/src/lib/elementary/elm_widget_colorselector.h
index 943297a778..a6bd8d38d6 100644
--- a/src/lib/elementary/elm_widget_colorselector.h
+++ b/src/lib/elementary/elm_widget_colorselector.h
@@ -49,6 +49,10 @@ struct _Elm_Colorselector_Data
49#endif 49#endif
50 } grab; 50 } grab;
51 51
52 /* focus support data */
53 Elm_Object_Item *focused_item;
54 Eina_List *focus_items;
55
52 Eina_List *items, *selected; 56 Eina_List *items, *selected;
53 Color_Bar_Data *cb_data[4]; 57 Color_Bar_Data *cb_data[4];
54 58