rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=18bae0bdb990a5174543cc12e3b831d5810a24a2
commit 18bae0bdb990a5174543cc12e3b831d5810a24a2 Author: Elizabeth Shevchenko <l.shevche...@samsung.com> Date: Wed Nov 11 15:42:34 2015 +0200 Property: select/unselect sound tab on click on it --- src/bin/ui/property.c | 32 +++++++++++++++++++++++++++++--- src/bin/ui/tabs.c | 2 +- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/bin/ui/property.c b/src/bin/ui/property.c index 5295d56..26a8dd6 100644 --- a/src/bin/ui/property.c +++ b/src/bin/ui/property.c @@ -77,7 +77,8 @@ _on_frame_click(void *data, (group's, image's, sound's or other kind of peroperty) */ enum _Property_Type { PROPERTY, - IMAGE_PROPERTY + IMAGE_PROPERTY, + SOUND_PROPERTY }; typedef enum _Property_Type Property_Type; @@ -108,6 +109,7 @@ _on_different_clicked(void *data, /* hide everything */ evas_object_hide(pd->group_property); evas_object_hide(pd->image_property); + evas_object_hide(pd->sound_property); pd->type = PROPERTY; } @@ -127,11 +129,32 @@ _on_image_editor_clicked(void *data, elm_object_content_set(pd->layout, pd->image_property); evas_object_hide(pd->group_property); evas_object_show(pd->image_property); + evas_object_hide(pd->sound_property); pd->type = IMAGE_PROPERTY; } static void +_on_sound_editor_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) +{ + Evas_Object *property = data; + PROP_DATA_GET() + + assert(pd != NULL); + + ui_property_group_unset(pd->group_property); + elm_object_content_unset(pd->layout); + elm_object_content_set(pd->layout, pd->sound_property); + evas_object_hide(pd->group_property); + evas_object_hide(pd->image_property); + evas_object_show(pd->sound_property); + + pd->type = SOUND_PROPERTY; +} + +static void _on_tab_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info) @@ -149,13 +172,14 @@ _on_tab_changed(void *data, return; } /* it has group here, and group's tab was clicked, - but if previous tab was image_property tab, + but if previous tab was image_property or sound_property tab, we need to remove it from there and set group property in there */ - if (pd->type == IMAGE_PROPERTY) + if ((pd->type == IMAGE_PROPERTY) || (pd->type == SOUND_PROPERTY)) { elm_object_content_unset(pd->layout); elm_object_content_set(pd->layout, pd->group_property); evas_object_hide(pd->image_property); + evas_object_hide(pd->sound_property); } ui_property_group_set(pd->group_property, group); @@ -182,10 +206,12 @@ ui_property_add(Evas_Object *parent) evas_object_data_set(pd->layout, PROP_DATA, pd); pd->image_property = ui_property_image_add(pd->layout); + pd->sound_property = ui_property_sound_add(pd->layout); /* register global callbacks */ evas_object_smart_callback_add(ap.win, SIGNAL_TAB_CHANGED, _on_tab_changed, pd->layout); evas_object_smart_callback_add(ap.win, SIGNAL_IMAGE_EDITOR_TAB_CLICKED, _on_image_editor_clicked, pd->layout); + evas_object_smart_callback_add(ap.win, SIGNAL_SOUND_EDITOR_TAB_CLICKED, _on_sound_editor_clicked, pd->layout); evas_object_smart_callback_add(ap.win, SIGNAL_DIFFERENT_TAB_CLICKED, _on_different_clicked, pd->layout); return pd->layout; diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c index d1f0159..3f57159 100644 --- a/src/bin/ui/tabs.c +++ b/src/bin/ui/tabs.c @@ -126,7 +126,7 @@ _content_set(void *data, if (toolbar_item == tabs.menu.item_sound) { tabs_menu_tab_open(TAB_SOUND_EDITOR); - evas_object_smart_callback_call(ap.win, SIGNAL_DIFFERENT_TAB_CLICKED, NULL); + evas_object_smart_callback_call(ap.win, SIGNAL_SOUND_EDITOR_TAB_CLICKED, NULL); } else if (toolbar_item == tabs.menu.item_text) { --