elementary label: use text width when label calculates duration for slide 34/87234/2
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 7 Sep 2016 04:20:52 +0000 (13:20 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 19 Sep 2016 05:19:28 +0000 (22:19 -0700)
Summary:
When developers customize theme for making different type of sliding label,
it would be better to send a duration based on whole text.
[The whole text width - label object's w] is only useful for short, bounce
type sliding.

Test Plan: N/A

Reviewers: raster, tasn, herdsman, cedric

Reviewed By: cedric

Subscribers: minkyu, akanad, z-wony, Blackmole, jpeg

Differential Revision: https://phab.enlightenment.org/D4255

Change-Id: I92e0a4bca43e456b92cba9654a13b59ac138a907

src/lib/elm_label.c

index 81225b6..f1ce087 100644 (file)
@@ -139,8 +139,12 @@ _label_slide_change(Evas_Object *obj)
         // calculate speed or duration
         if (!strcmp(elm_object_style_get(obj), "slide_long"))
           w = tb_w + w;
-        else // slide_short or slide_bounce
+        else if (!strcmp(elm_object_style_get(obj), "slide_short") ||
+                 !strcmp(elm_object_style_get(obj), "slide_bounce")) // slide_short or slide_bounce
           w = tb_w - w;
+        else
+          w = tb_w;
+
         if (sd->use_slide_speed)
           {
              if (sd->slide_speed <= 0) sd->slide_speed = 1;