aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerrit User <gerrit@106.125.46.94>2015-12-23 15:14:22 +0200
committerGerrit Code Review <tomcat7@spas0064.surc.kiev.ua>2015-12-23 15:14:23 +0200
commit7949b9b85fe76e5fd7ca52874aa7676e0e151211 (patch)
tree013a4c8ec47595a4a801697583cb867e31067b47
parentMerge "editor: tween add and del" (diff)
parentproperty_group: history add and del of tweens (diff)
downloadeflete-7949b9b85fe76e5fd7ca52874aa7676e0e151211.tar.gz
Merge "property_group: history add and del of tweens"
-rw-r--r--src/bin/ui/property_group.c67
1 files changed, 45 insertions, 22 deletions
diff --git a/src/bin/ui/property_group.c b/src/bin/ui/property_group.c
index 26daacdb4..fd6907865 100644
--- a/src/bin/ui/property_group.c
+++ b/src/bin/ui/property_group.c
@@ -433,6 +433,9 @@ prop_part_item_padding_update(Group_Prop_Data *pd);
static void
prop_state_proxy_source_update(Group_Prop_Data *pd);
+static void
+prop_item_state_image_tween_update(Evas_Object *tween, Group_Prop_Data *pd);
+
static Elm_Gengrid_Item_Class *_itc_tween = NULL;
static void
@@ -878,7 +881,7 @@ _on_editor_attribute_changed(void *data,
STATE_ATTR_1COMBOBOX_LIST_UPDATE(state_fill, type, state_fill);
break;
case ATTRIBUTE_STATE_IMAGE_TWEEN:
-/* prop_item_state_image_tween_update(pd->attributes.state_image.tween, pd); */
+ prop_item_state_image_tween_update(pd->attributes.state_image.tween, pd);
break;
/* Don't add 'default:'. Compiler must warn about missing cases */
}
@@ -2905,20 +2908,35 @@ _del_tween_image(void *data,
void *event_info __UNUSED__)
{
Evas_Object *tween_list = (Evas_Object *)data;
- Elm_Object_Item *it = elm_gengrid_selected_item_get(tween_list);
- Eina_Stringshare *selected = elm_object_item_data_get(it);
+ const Eina_List *sel_list = elm_gengrid_selected_items_get(tween_list), *l;
+ Eina_List *selected = NULL;
+ Elm_Object_Item *it;
+ const char *name;
Group_Prop_Data *pd = evas_object_data_get(tween_list, GROUP_PROP_DATA);
assert(pd != NULL);
- if ((!selected) || (!it) || (!pd)) return;
- if (edje_edit_state_tween_del(pd->group->edit_object, pd->part->name,
- pd->part->current_state->parsed_name, pd->part->current_state->parsed_val,
- selected))
+ EINA_LIST_FOREACH(sel_list, l, it)
+ {
+ name = elm_object_item_data_get(it);
+ selected = eina_list_append(selected, eina_stringshare_add(name));
+ }
+
+ Eina_Stringshare *msg = eina_stringshare_printf(_("removed %d tween images"),
+ eina_list_count(sel_list));
+ Change *change = change_add(msg);
+ eina_stringshare_del(msg);
+ EINA_LIST_FOREACH(selected, l, name)
{
- elm_object_item_del(it);
- //project_changed(false);
+ editor_state_tween_del(pd->group->edit_object, change, false,
+ pd->part->name,
+ pd->part->current_state->parsed_name,
+ pd->part->current_state->parsed_val,
+ name);
+ eina_stringshare_del(name);
}
+ eina_list_free(selected);
+ history_change_add(pd->group->history, change);
}
Eina_Bool
@@ -2935,18 +2953,20 @@ _on_image_editor_tween_done(void *data,
assert(pd != NULL);
if (!selected) return false;
-
+ Eina_Stringshare *msg = eina_stringshare_printf(_("added %d tween images"),
+ eina_list_count(selected));
+ Change *change = change_add(msg);
+ eina_stringshare_del(msg);
EINA_LIST_FOREACH(selected, l, name)
{
- if (edje_edit_state_tween_add(pd->group->edit_object, pd->part->name,
- pd->part->current_state->parsed_name,
- pd->part->current_state->parsed_val, name))
- {
- elm_gengrid_item_append(tween_list, _itc_tween,
- eina_stringshare_add(name), NULL, NULL);
- //project_changed(false);
- }
+ editor_state_tween_add(pd->group->edit_object, change, false,
+ pd->part->name,
+ pd->part->current_state->parsed_name,
+ pd->part->current_state->parsed_val,
+ eina_stringshare_add(name));
}
+ history_change_add(pd->group->history, change);
+
return true;
}
@@ -3079,6 +3099,7 @@ prop_item_state_image_tween_add(Evas_Object *box, Group_Prop_Data *pd)
elm_gengrid_item_size_set(tween_list, 96, 111);
elm_gengrid_align_set(tween_list, 0.0, 0.0);
elm_gengrid_horizontal_set(tween_list, true);
+ elm_gengrid_multi_select_set(tween_list, true);
evas_object_data_set(tween_list, GROUP_PROP_DATA, pd);
@@ -3134,8 +3155,9 @@ prop_item_state_image_tween_update(Evas_Object *tween, Group_Prop_Data *pd)
assert(tween != NULL);
assert(pd != NULL);
- tween_list = elm_object_content_get(tween);
- elm_genlist_clear(tween_list);
+ /* Tween_List -> Item(Layout) -> Frame(Tween) */
+ tween_list = elm_object_content_get(elm_object_content_get(tween));
+ elm_gengrid_clear(tween_list);
images_list = edje_edit_state_tweens_list_get(pd->group->edit_object,
pd->part->name,
pd->part->current_state->parsed_name,
@@ -3145,10 +3167,11 @@ prop_item_state_image_tween_update(Evas_Object *tween, Group_Prop_Data *pd)
EINA_LIST_FOREACH(images_list, l, image_name)
{
- elm_genlist_item_append(tween_list, _itc_tween, image_name, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_gengrid_item_append(tween_list, _itc_tween,
+ eina_stringshare_add(image_name), NULL, NULL);
}
edje_edit_string_list_free(images_list);
+ evas_object_show(tween_list);
}
#define SPINNER_SET(SUB, VALUE, SPINNER, PART) \