group {
name: "magnifier";
images {
- image: "magnifier.png" COMP;
+ image: "magnifier_left.png" COMP;
+ image: "magnifier_middle.png" COMP;
+ image: "magnifier_right.png" COMP;
}
parts {
part {
- name: "magnifier_bg";
- type: SWALLOW;
- scale : 1;
+ name: "bg";
+ mouse_events: 0;
+ scale: 1;
+ type: RECT;
description {
state: "default" 0.0;
+ fixed: 1 1;
+ min: 352 177;
+ align: 0.5 0.0;
visible: 1;
- align: 0.5 0.5;
- min: 340 180;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 1.0; }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "bg_left";
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ fixed: 1 1;
+ min: 146 177;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel2 { relative: 0.5 1.0; to: "bg"; offset: -20 -1;}
+ image {
+ normal: "magnifier_left.png";
+ border: 21 1 20 44;
+ }
+ image.middle: 1;
+ fill.smooth: 0;
+ }
+ }
+ part {
+ name: "bg_middle";
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ fixed: 1 1;
+ min: 40 177;
+ max: 40 999999;
+ align: 0.0 0.0;
+ rel1 { relative: 1.0 0.0; to: "bg_left"; }
+ rel2 { relative: 0.0 1.0; to: "bg_right"; }
+ image {
+ normal: "magnifier_middle.png";
+ border: 0 40 20 44;
+ }
+ image.middle: 1;
+ fill.smooth: 0;
+ }
+ }
+ part {
+ name: "bg_right";
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ fixed: 1 1;
+ min: 146 177;
+ rel1 { relative: 0.5 0.0; to: "bg"; offset: 21 0;}
+ rel2.to: "bg";
+ image {
+ normal: "magnifier_right.png";
+ border: 1 21 20 44;
+ }
+ image.middle: 1;
+ fill.smooth: 0;
}
}
part {
- name: "magnifier_frame";
+ name: "swallow";
type: SWALLOW;
- scale : 1;
+ mouse_events: 0;
+ scale: 1;
description {
state: "default" 0.0;
- align: 0.5 0.5;
- min: 300 100;
- visible: 1;
+ fixed: 1 1;
+ align: 0.0 0.0;
rel1 {
- relative: 1.0 0.0;
- offset: 0 165;
- to: "magnifier_bg";
+ to: "bg";
+ offset: 21-5 22-8; //need to update when image with rounded corners releases
}
rel2 {
- relative: 0.0 0.0;
- to: "magnifier_bg";
+ to: "bg";
+ offset: -21+5 -44+10;
}
}
}
}
}
-}
-
+}
\ No newline at end of file
: m_viewImpl(viewImpl)
, m_image(0)
, m_magnifier(0)
- , m_magnifierBackground(0)
- , m_magnifierFrame(0)
- , m_width(300)
- , m_height(100)
+ , m_width(320)
+ , m_height(120)
{
}
elm_layout_file_set(m_magnifier, EDJE_DIR"/Magnifier.edj", "magnifier");
}
- m_magnifierBackground = elm_image_add(m_magnifier);
- elm_image_file_set(m_magnifierBackground, MAGNIFIER_IMAGE_PATH, 0);
- elm_object_part_content_set(m_magnifier, "magnifier_bg", m_magnifierBackground);
- evas_object_show(m_magnifierBackground);
-
- m_magnifierFrame = elm_frame_add(m_magnifier);
-
int viewX, viewY, viewWidth, viewHeight;
evas_object_geometry_get(m_viewImpl->view(), &viewX, &viewY, &viewWidth, &viewHeight);
evas_object_image_filled_set(m_image, true);
evas_object_show(m_image);
- elm_object_content_unset(m_magnifierFrame);
- elm_object_content_set(m_magnifierFrame, m_image);
+ elm_object_part_content_set(m_magnifier, "swallow", m_image);
+ evas_object_pass_events_set(m_image, EINA_TRUE);
+ evas_object_clip_set(m_image, m_magnifier);
- elm_object_style_set(m_magnifierFrame, "pad_small");
- elm_object_part_content_set(m_magnifier, "magnifier_frame", m_magnifierFrame);
- evas_object_show(m_magnifierFrame);
+ evas_object_layer_set(m_magnifier, EVAS_LAYER_MAX);
+ evas_object_layer_set(m_image, EVAS_LAYER_MAX);
}
void TextSelectionMagnifier::show()
evas_object_geometry_get(m_viewImpl->view(), &viewX, &viewY, &viewWidth, &viewHeight);
int magnfierX, magnfierY, magnfierWidth, magnfierHeight;
- evas_object_geometry_get(m_magnifierBackground, &magnfierX, &magnfierY, &magnfierWidth, &magnfierHeight);
+ evas_object_geometry_get(m_magnifier, &magnfierX, &magnfierY, &magnfierWidth, &magnfierHeight);
int xPosition = point.x();
if (xPosition < (magnfierWidth / 2))
if (xPosition > viewWidth - (magnfierWidth / 2))
xPosition = viewWidth - (magnfierWidth / 2);
- int yPosition = point.y() - 130;
+ int yPosition = point.y() - 230;
if (yPosition < (magnfierHeight / 2))
yPosition = magnfierHeight / 2;
if (yPosition > viewHeight - (magnfierHeight / 2))