Edje: Add color class feature for textblock properties.
authorSubodh Kumar <s7158.kumar@samsung.com>
Tue, 3 Dec 2019 11:48:18 +0000 (17:18 +0530)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 9 Dec 2019 00:11:25 +0000 (09:11 +0900)
These properties were missing, as underline color is being used used heavily.
There is link pressed effect feature which requires color class for underline color.
Also link pressed effect works on link tag. So link tag is provided by default and if app
wants to customises the color then whole style needs to be rrecreated so replacing
color code for link tag will work as aspected.

Change-Id: I04e826a64610981a0491d753a855d5c8984fc259

src/lib/edje/edje_private.h
src/lib/edje/edje_textblock_styles.c

index 52c2ec3..d42a3fb 100644 (file)
@@ -652,6 +652,9 @@ struct _Edje_Style_Tag
    Edje_Color                     color;
    Edje_Color                     outline_color;
    Edje_Color                     shadow_color;
+   Edje_Color                     underline_color;
+   Edje_Color                     underline_dash_color;
+   Edje_Color                     backing_color;
    /*******
     * END *
     *******/
index 882c19f..b003363 100644 (file)
@@ -389,7 +389,18 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag *tag, Eina_
              else if ((key_len == 12) && !strncmp(key, "shadow_color", key_len))
                {
                   _parse_color(val, &(tag->shadow_color));
-
+               }
+             else if ((key_len == 20) && !strncmp(key, "underline_dash_color", key_len))
+               {
+                   _parse_color(val, &(tag->underline_dash_color));
+               }
+             else if ((key_len == 15) && !strncmp(key, "underline_color", key_len))
+               {
+                   _parse_color(val, &(tag->underline_color));
+               }
+             else if ((key_len == 15) && !strncmp(key, "backing_color", key_len))
+               {
+                   _parse_color(val, &(tag->backing_color));
                }
              /*******
               * END *
@@ -550,6 +561,36 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl)
                   eina_strbuf_append(txt, color);
                }
           }
+        if (cc && tag->underline_dash_color.a)
+          {
+             Eina_Bool result = _edje_textblock_color_calc(&(tag->underline_dash_color),
+                                        cc->r, cc->g, cc->b, cc->a, color);
+             if (result)
+               {
+                  eina_strbuf_append(txt, " underline_dash_color=");
+                  eina_strbuf_append(txt, color);
+               }
+          }
+        if (cc && tag->underline_color.a)
+          {
+             Eina_Bool result = _edje_textblock_color_calc(&(tag->underline_color),
+                                        cc->r, cc->g, cc->b, cc->a, color);
+             if (result)
+               {
+                  eina_strbuf_append(txt, " underline_color=");
+                  eina_strbuf_append(txt, color);
+               }
+          }
+        if (cc && tag->backing_color.a)
+          {
+             Eina_Bool result = _edje_textblock_color_calc(&(tag->backing_color),
+                                        cc->r, cc->g, cc->b, cc->a, color);
+             if (result)
+               {
+                  eina_strbuf_append(txt, " underline_dash_color=");
+                  eina_strbuf_append(txt, color);
+               }
+          }
         /*******
          * END *
          *******/