live_edit: remove margin in the spacer image.

spacer margin should be removed from the image
because live edit needs accruate pixel control.
on the other hands, spacer button icon needs margin.

this implementation is a little tricky but i have no idea better than this.
This commit is contained in:
Hermet Park 2016-05-20 00:32:25 +09:00
parent 9ae16dce31
commit c32e417d5d
6 changed files with 11 additions and 2 deletions

View File

@ -21,6 +21,7 @@ images {
image: "live_rectangle.png" COMP;
image: "live_swallow.png" COMP;
image: "live_spacer.png" COMP;
image: "live_spacer_icon.png" COMP;
image: "live_text.png" COMP;
image: "live_textblock.png" COMP;
image: "expand.png" COMP;
@ -75,6 +76,7 @@ ICON_GROUP("invert", "invert.png")
ICON_GROUP("Image", "live_image.png")
ICON_GROUP("Rect", "live_rectangle.png")
ICON_GROUP("Spacer", "live_spacer.png")
ICON_GROUP("Spacer_Icon", "live_spacer_icon.png")
ICON_GROUP("Swallow", "live_swallow.png")
ICON_GROUP("Text", "live_text.png")
ICON_GROUP("Textblock", "live_textblock.png")

View File

@ -56,6 +56,7 @@ EXTRA_DIST = \
live_rectangle.png \
live_swallow.png \
live_spacer.png \
live_spacer_icon.png \
live_text.png \
live_textblock.png \
new.png \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

View File

@ -120,7 +120,7 @@ static const liveedit_item LIVEEDIT_ITEMS[] =
{"Image", EDJE_PART_TYPE_IMAGE},
{"Swallow", EDJE_PART_TYPE_SWALLOW},
{"Textblock", EDJE_PART_TYPE_TEXTBLOCK},
{"Spacer", EDJE_PART_TYPE_SPACER}
{"Spacer", EDJE_PART_TYPE_SPACER} //Please leave spacer at last
};
static Evas_Object *
@ -2005,13 +2005,19 @@ live_edit_tools_create(Evas_Object *parent)
Evas_Object *btn;
int i;
for (i = 0; i < LIVEEDIT_ITEMS_NUM; i++)
for (i = 0; i < (LIVEEDIT_ITEMS_NUM - 1); i++)
{
btn = live_btn_create(parent, LIVEEDIT_ITEMS[i].name,
(void *)(uintptr_t) i);
btn_list = eina_list_append(btn_list, btn);
}
//Just for spacer. Because we'd like to avoid margin in the icon image,
//We use 2 images - button icon's and live edit object's.
btn = live_btn_create(parent, "Spacer_Icon",
(void *)(uintptr_t) i);
btn_list = eina_list_append(btn_list, btn);
return btn_list;
}