min, 294 294;
color, 194 194 194 255;
}
+ description {
+ state, "focus" 0.0;
+ inherit, "default" 0.0;
+ color, 0 119 246 255;
+ }
}
part {
name, "bg.photo";
scale, 1;
description {
state, "default" 0.0;
- rel1.to, "bg.photo";
- rel2.to, "bg.photo";
fixed, 1 1;
}
}
scale, 1;
description {
state, "default" 0.0;
- rel1.relative, 0.5 0.5;
- rel2.relative, 0.5 0.5;
- fixed, 1 1;
- min, 290 290;
color, 0 119 246 255;
visible, 0;
}
visible, 1;
}
}
-
part {
name, PART_USER_EDIT_PHOTO_FOCUS;
type, SWALLOW;
clip_to, "clip";
description {
state, "default" 0.0;
- rel1.to, PART_USER_EDIT_PHOTO;
- rel2.to, PART_USER_EDIT_PHOTO;
fixed, 1 1;
}
}
source, SRC_PROG;
action, STATE_SET "focus" 0.0;
target, "bg.photo";
+ target, "bg";
target, "clip";
after, "sig,focus,1";
}
action, STATE_SET "default" 0.0;
transition, TRANSITION_LINEAR;
target, "bg.photo";
+ target, "bg";
target, "clip";
}
}
#define CTXPOPUP_X 294
#define CTXPOPUP_Y 310
#define MAX_BUF 128
+#define MAX_PHOTO 160
enum input_handler_type {
INPUT_HANDLER_TYPE_PHOTO,
return true;
}
+static Evas_Object *_add_icon(Evas_Object *photo, const char *file,
+ const char *part)
+{
+ Evas_Object *icon;
+ int w, h;
+
+ icon = elm_image_add(photo);
+ if (!icon) {
+ _ERR("failed to add image");
+ return NULL;
+ }
+
+ elm_image_file_set(icon, file, NULL);
+ elm_image_object_size_get(icon, &w, &h);
+
+ if (w > MAX_PHOTO && h > MAX_PHOTO)
+ elm_image_fill_outside_set(icon, EINA_TRUE);
+ else
+ elm_image_resizable_set(icon, EINA_FALSE, EINA_FALSE);
+
+ elm_object_part_content_set(photo, part, icon);
+
+ return icon;
+}
+
static void _load_user_icon(struct _priv *priv, const char *file,
const char *focus_file)
{
Evas_Object *icon, *focus_icon;
- icon = utils_add_icon(priv->photo, file, PART_USER_EDIT_PHOTO);
+ icon = _add_icon(priv->photo, file, PART_USER_EDIT_PHOTO);
if (!icon)
_ERR("failed to add icon");
- focus_icon = utils_add_icon(priv->photo, focus_file,
+ focus_icon = _add_icon(priv->photo, focus_file,
PART_USER_EDIT_PHOTO_FOCUS);
if (!focus_icon)
_ERR("failed to add focus icon");