[Copy&PasteUI] Limit copy&paste ctxpopup's showing position within entry's viewport
authorThiep Ha <thiep.ha@samsung.com>
Thu, 18 Apr 2013 07:08:44 +0000 (16:08 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 04:18:35 +0000 (13:18 +0900)
Change-Id: Ia03762f64efb5f1efcc07a45be6915647d958ed0

src/modules/ctxpopup_copypasteUI/copypaste.c

index 88ffe02..c3046b7 100644 (file)
@@ -165,6 +165,21 @@ _ctxpopup_position(Evas_Object *obj __UNUSED__)
              y = ey + cy;
           }
 
+        //limit ctx in viewport
+        if (ext_mod->viewport_rect.x != -1 || ext_mod->viewport_rect.y != -1
+            || ext_mod->viewport_rect.w != -1 || ext_mod->viewport_rect.h != -1)
+          {
+             if (ext_mod->viewport_rect.x > x)
+               x = ext_mod->viewport_rect.x;
+             else if (x > ext_mod->viewport_rect.x + ext_mod->viewport_rect.w)
+               x = ext_mod->viewport_rect.x + ext_mod->viewport_rect.w;
+
+             if (ext_mod->viewport_rect.y > y)
+               y = ext_mod->viewport_rect.y;
+             else if (y > ext_mod->viewport_rect.y + ext_mod->viewport_rect.h)
+               y = ext_mod->viewport_rect.y + ext_mod->viewport_rect.h;
+          }
+
         evas_object_move(ext_mod->popup, x, y);
         evas_object_resize(ext_mod->popup, cw, ch);
      }