From b26ed5ba23da7024edbf3da1c71ad384ac20a52d Mon Sep 17 00:00:00 2001 From: Vladyslav Shevchenko Date: Tue, 8 Sep 2015 18:08:40 +0300 Subject: [PATCH] Fix layout's part max size and spinners callbacks assignment in code sample Change-Id: Ie60fd9a685d09c8cf66616e2a785509f65b86350 Signed-off-by: Vladyslav Shevchenko --- .../html/native/efl/edje_scaling_n.htm | 50 +++++++++++----------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm b/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm index 694956d..a86b0b1 100644 --- a/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm +++ b/org.tizen.ui.practices/html/native/efl/edje_scaling_n.htm @@ -252,7 +252,7 @@ group          {             state: "default" 0.0;             align: 0.0 0.0; -            max: 200 48; +            max: 220 48;             rel1             {                relative: 1.0 0.0; @@ -274,7 +274,7 @@ group          {             state: "default" 0.0;             align: 0.0 0.0; -            max: 200 48; +            max: 220 48;             rel1             {                relative: 1.0 0.0; @@ -417,7 +417,7 @@ elm_spinner_min_max_set(ad->edje_object_scale, 1, 300); elm_spinner_step_set(ad->edje_object_scale, 10); evas_object_show(ad->edje_object_scale); elm_spinner_value_set(ad->edje_object_scale, 100); -elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_scale); +elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_object_scale);
  • Display the window:

    @@ -435,22 +435,22 @@ evas_object_show(ad->win);
    1. -

      Add a callback for the second spinner that changes Edje global scale value and, as a result, affects all loaded Edje objects:

      +

      Add a callback for the first spinner that changes Edje global scale value and, as a result, affects all loaded Edje objects:

      static void
       create_base_gui(appdata_s *ad)
       {
          // Add scale spinners
      -   ad->edje_object_scale = elm_spinner_add(ad->win);
      -   evas_object_size_hint_weight_set(ad->edje_object_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
      -   evas_object_size_hint_align_set(ad->edje_object_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
      -   elm_spinner_min_max_set(ad->edje_object_scale, 1, 300);
      -   elm_spinner_step_set(ad->edje_object_scale, 10);
      -   evas_object_show(ad->edje_object_scale);
      -   elm_spinner_value_set(ad->edje_object_scale, 100);
      -   elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_object_scale);
      +   ad->edje_scale = elm_spinner_add(ad->win);
      +   evas_object_size_hint_weight_set(ad->edje_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
      +   evas_object_size_hint_align_set(ad->edje_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
      +   elm_spinner_min_max_set(ad->edje_scale, 1, 300);
      +   elm_spinner_step_set(ad->edje_scale, 10);
      +   evas_object_show(ad->edje_scale);
      +   elm_spinner_value_set(ad->edje_scale, 100);
      +   elm_object_part_content_set(ad->main_layout, "scale.swallow", ad->edje_scale);
       
      -   evas_object_smart_callback_add(ad->edje_object_scale, "changed", _on_global_scale_change, ad);
      +   evas_object_smart_callback_add(ad->edje_scale, "changed", _on_global_scale_change, ad);
       }
    2. @@ -484,7 +484,7 @@ _on_global_scale_change(void *data, Evas_Object *obj, void *event_info)

      Setting Scales for Edje Objects

      -

      Add a callback to get the value of the first spinner and apply it to the Edje object on the right:

      +

      Add a callback to get the value of the second spinner and apply it to the Edje object on the right:

      static void
       _on_scale_change(void *data, Evas_Object *obj, void *event_info)
      @@ -497,15 +497,15 @@ static void
       create_base_gui(appdata_s *ad)
       {
          // Add scale spinners
      -   ad->edje_scale = elm_spinner_add(ad->win);
      -   evas_object_size_hint_weight_set(ad->edje_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
      -   evas_object_size_hint_align_set(ad->edje_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
      -   elm_spinner_min_max_set(ad->edje_scale, 1, 300);
      -   elm_spinner_step_set(ad->edje_scale, 10);
      -   evas_object_show(ad->edje_scale);
      -   elm_spinner_value_set(ad->edje_scale, 100);
      -   elm_object_part_content_set(ad->main_layout, "scale.swallow", ad->edje_scale);
      -   evas_object_smart_callback_add(ad->edje_scale, "changed", _on_scale_change, ad);
      +   ad->edje_object_scale = elm_spinner_add(ad->win);
      +   evas_object_size_hint_weight_set(ad->edje_object_scale, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
      +   evas_object_size_hint_align_set(ad->edje_object_scale, EVAS_HINT_FILL, EVAS_HINT_FILL);
      +   elm_spinner_min_max_set(ad->edje_object_scale, 1, 300);
      +   elm_spinner_step_set(ad->edje_object_scale, 10);
      +   evas_object_show(ad->edje_object_scale);
      +   elm_spinner_value_set(ad->edje_object_scale, 100);
      +   elm_object_part_content_set(ad->main_layout, "scale.swallow2", ad->edje_object_scale);
      +   evas_object_smart_callback_add(ad->edje_object_scale, "changed", _on_scale_change, ad);
       }
      @@ -602,7 +602,7 @@ group          {             state: "default" 0.0;             align: 0.0 0.0; -            max: 200 48; +            max: 220 48;             rel1             {                relative: 1.0 0.0; @@ -624,7 +624,7 @@ group          {             state: "default" 0.0;             align: 0.0 0.0; -            max: 200 48; +            max: 220 48;             rel1             {                relative: 1.0 0.0; -- 2.7.4