Add custom genlist stye for common profile 19/233719/2
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 18 May 2020 11:58:51 +0000 (20:58 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 18 May 2020 11:59:52 +0000 (20:59 +0900)
Change-Id: Ic2de906184e5ddac09e96c643e799bb3aa876eb9

packaging/wifi-efl-ug.spec
sources/libraries/Common/common_ip_info.c
sources/ui-gadget/edcs/custom_genlist.edc

index 0ad50f1..4614720 100644 (file)
@@ -1,6 +1,6 @@
 Name:          wifi-efl-ug
 Summary:       Wi-Fi UI Gadget for TIZEN
-Version:       1.0.246
+Version:       1.0.247
 Release:       1
 Group:         App/Network
 License:       Flora-1.1
index 759d706..9628e8f 100755 (executable)
@@ -20,6 +20,7 @@
 #include <glib.h>
 
 #include "common.h"
+#include "common_utils.h"
 #include "ug_wifi.h"
 #include "common_ip_info.h"
 #include "i18nmanager.h"
@@ -104,15 +105,22 @@ static Evas_Object *_ip_info_detail_description_content_get(void *data,
 
        Evas_Object *layout = NULL;
        Evas_Object *title_label = NULL;
+       UG_TYPE ug_type = common_util_get_ug_type();
        char buf[MAX_LABEL_LENGTH] = {0, };
+       int font_size = ug_type == UG_VIEW_IOT_COMMON ? 20 : 40;
 
        layout = elm_layout_add(obj);
-       elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_item");
+       if (ug_type == UG_VIEW_IOT_COMMON)
+               elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_common_item");
+       else
+               elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_item");
+
        evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        title_label = elm_label_add(obj);
-       snprintf(buf, MAX_LABEL_LENGTH, "<font_size=40>%s</font_size>", dgettext(PACKAGE, det->title));
+       snprintf(buf, MAX_LABEL_LENGTH, "<font_size=%d>%s</font_size>",
+                       font_size, dgettext(PACKAGE, det->title));
 
        elm_object_text_set(title_label, buf);
        evas_object_size_hint_weight_set(title_label, EVAS_HINT_EXPAND, 0);
@@ -420,8 +428,10 @@ static Evas_Object *_ip_info_entry_item_content_get(void *data, Evas_Object *obj
        char *guide_txt = NULL;
        char *accepted = NULL;
        Elm_Input_Panel_Layout panel_type;
+       UG_TYPE ug_type = common_util_get_ug_type();
        int return_key_type;
        char buf[MAX_LABEL_LENGTH] = {0, };
+       int font_size = ug_type == UG_VIEW_IOT_COMMON ? 20 : 40;
 
        switch (entry_info->entry_id) {
        case ENTRY_TYPE_IP_ADDR:
@@ -452,12 +462,16 @@ static Evas_Object *_ip_info_entry_item_content_get(void *data, Evas_Object *obj
        }
 
        layout = elm_layout_add(obj);
-       elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_item");
+       if (ug_type == UG_VIEW_IOT_COMMON)
+               elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_common_item");
+       else
+               elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_item");
+
        evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
-       snprintf(buf, MAX_LABEL_LENGTH, "<font_size=40>%s</font_size>",
-                       dgettext(PACKAGE, entry_info->title_txt));
+       snprintf(buf, MAX_LABEL_LENGTH, "<font_size=%d>%s</font_size>",
+                       font_size, dgettext(PACKAGE, entry_info->title_txt));
 
        label = elm_label_add(obj);
        evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0);
index 4f66bbd..158284b 100755 (executable)
  *  limitations under the License.
  *
  */
+
+#define CUSTOM_GENLIST_LR_PADDING 60
+#define CUSTOM_GENLIST_TB_PADDING 20
+
 styles {
    style { "custom_textblock_style";
       base: "font=Tizen:weight=Light font_size=40 color=#000 text_class=entry ellipsis=1.0 left_margin=5 right_margin=5";
@@ -23,6 +27,15 @@ styles {
       tag:  "b" "+ font_weight=Bold";
       tag:  "tab" "\t";
    }
+
+   style { "custom_common_textblock_style";
+      base: "font=Tizen:weight=Light font_size=30 color=#000 text_class=entry ellipsis=1.0 left_margin=5 right_margin=5";
+      tag:  "br" "\n";
+      tag:  "ps" "ps";
+      tag:  "hilight" "+ font_weight=Bold";
+      tag:  "b" "+ font_weight=Bold";
+      tag:  "tab" "\t";
+   }
 }
 
 collections {
@@ -139,4 +152,125 @@ group { name: "gl_custom_item";
       }
    }
 }
+
+group { name: "gl_custom_common_item";
+   parts {
+      part { name: "base";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+         }
+      }
+      part { name: "bg";
+         type: RECT;
+         description {
+            color: 255 255 255 255;
+            rel1.to:"base";
+            rel2.to:"base";
+         }
+      }
+      part { name: "left_padding";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: CUSTOM_GENLIST_LR_PADDING 0;
+            align: 0.0 0.5;
+            rel1 { to: "base"; relative: 0.0 0.0; }
+            rel2 { to: "base"; relative: 0.0 1.0; }
+            fixed: 1 0;
+         }
+      }
+      part { name: "right_padding";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: CUSTOM_GENLIST_LR_PADDING 0;
+            align: 1.0 0.5;
+            rel1 { to: "base"; relative: 1.0 0.0; }
+            rel2 { to: "base"; relative: 1.0 1.0; }
+            fixed: 1 0;
+         }
+      }
+      part { name: "top_padding";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 CUSTOM_GENLIST_TB_PADDING;
+            align: 0.5 0.0;
+            rel1 { to: "base"; }
+            rel2 { to: "base"; relative: 1.0 0.0; }
+            fixed: 0 1;
+         }
+      }
+      part { name: "elm.swallow.label";
+         type: SWALLOW;
+         scale: 1;
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            min: 0 23;
+            align: 0.0 0.0;
+            rel1 {
+               to_x: "left_padding";
+               to_y: "top_padding";
+               relative: 1.0 1.0;
+            }
+            rel2 {
+               to_x: "right_padding";
+               to_y: "top_padding";
+               relative: 0.0 1.0;
+            }
+            fixed: 0 1;
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            align: 0.5 0.0;
+            rel1 {
+               to_x: "left_padding";
+               to_y: "elm.swallow.label";
+               relative: 1.0 1.0;
+            }
+            rel2 {
+               to_x: "right_padding";
+               to_y: "bottom_padding";
+               relative: 0.0 0.0;
+            }
+         }
+      }
+      part { name: "elm.text";
+         type: TEXTBLOCK;
+         scale: 1;
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            rel1 {
+               to_x: "left_padding";
+               to_y: "elm.swallow.label";
+               relative: 1.0 1.0;
+            }
+            rel2 {
+               to_x: "right_padding";
+               to_y: "bottom_padding";
+               relative: 0.0 0.0;
+            }
+            text {
+               style: "custom_common_textblock_style";
+               min: 0 1;
+            }
+         }
+      }
+      part { name: "bottom_padding";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 CUSTOM_GENLIST_TB_PADDING;
+            align: 0.5 1.0;
+            rel1 { to: "base"; relative: 0.0 1.0; }
+            rel2 { to: "base"; relative: 1.0 1.0; }
+            fixed: 0 1;
+         }
+      }
+   }
+}
 }