elm win - fix wrong resizing of focus highlight obj.
authorWooHyun Jung <wh0705.jung@samsung.com>
Fri, 28 Mar 2014 05:17:02 +0000 (14:17 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Fri, 28 Mar 2014 05:17:02 +0000 (14:17 +0900)
When focus highlight animation is enabled, focus highlight can be
resized only by animator inside edje. So, if there is no animation
by some reasons, focus highlight just keeps its original.
@fix

data/themes/edc/elm/focus.edc
src/bin/test_focus.c
src/lib/elm_win.c

index 4e9563b..19d78cd 100644 (file)
@@ -148,5 +148,10 @@ group { name: "elm/focus_highlight/top/default";
          target: "sel";
          after: "pulse";
       }
+      program {
+         signal: "elm,state,anim,stop"; source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "base";
+      }
    }
 }
index 216ad50..f8d60ee 100644 (file)
@@ -57,6 +57,15 @@ _tb_sel(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
    printf("tb sel %p\n", obj);
 }
 
+static void
+_focus_anim_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+   if (elm_check_state_get(obj))
+     elm_win_focus_highlight_animate_set(data, EINA_TRUE);
+   else
+     elm_win_focus_highlight_animate_set(data, EINA_FALSE);
+}
+
 void
 test_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
@@ -409,6 +418,23 @@ test_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
                }
           }
      }
+
+   Evas_Object *bx = elm_box_add(win);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND,
+                                    EVAS_HINT_EXPAND);
+   elm_box_pack_end(tbx, bx);
+   my_show(bx);
+
+     {
+        Evas_Object *ck;
+        ck = elm_check_add(bx);
+        elm_object_text_set(ck, "Focus Highlight Animation Enable");
+        elm_box_pack_end(bx, ck);
+        my_show(ck);
+        evas_object_smart_callback_add(ck, "changed",
+                                       _focus_anim_changed,
+                                       win);
+     }
 }
 
 /**** focus 2 ****/
index 131e817..6c0bf7b 100644 (file)
@@ -750,6 +750,8 @@ _elm_win_focus_highlight_simple_setup(Elm_Win_Smart_Data *sd,
         clip = evas_object_clip_get(target);
         if (clip) evas_object_clip_set(obj, clip);
      }
+
+   edje_object_signal_emit(obj, "elm,state,anim,stop", "elm");
 }
 
 static void