[Toolbar] Fix the toolbar item checks the selected state when the text is set.
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 24 Apr 2013 07:28:11 +0000 (16:28 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 11:05:50 +0000 (20:05 +0900)
Change-Id: Ie16a3c56e2a08eec4ba59990a485ccfd9c113ff8

themes/widgets/toolbar.edc

index 8451cb3..a11c988 100644 (file)
@@ -1403,6 +1403,8 @@ group { name: "elm/toolbar/item/tabbar";
    script {
       public item_state = ITEM_STATE_ENABLED;
       public items_number = 0;
+      public selected = 0;
+      public temp;
    }
    parts {
       part { name: "bg";
@@ -2089,6 +2091,7 @@ group { name: "elm/toolbar/item/tabbar";
          script{
             new st[31];
             new Float:vl;
+            set_int(selected, 1);
             get_state(PART:"elm.text", st, 30, vl);
             if (!strcmp(st, "visible"))
               set_state(PART:"elm.text", "selected", vl);
@@ -2107,6 +2110,7 @@ group { name: "elm/toolbar/item/tabbar";
          script{
             new st[31];
             new Float:vl;
+            set_int(selected, 0);
             get_state(PART:"elm.text", st, 30, vl);
             if (!strcmp(st, "selected"))
               set_state(PART:"elm.text", "visible", vl);
@@ -2298,17 +2302,23 @@ group { name: "elm/toolbar/item/tabbar";
             get_state(PART:"elm.text", st, 30, vl);
             if (!strcmp(st, "default"))
               {
+                if (get_int(selected))
+                  set_str(temp, "selected");
+                else
+                  set_str(temp, "visible");
+                get_str(temp, st, 31);
+
                 if (get_int(items_number) <= 2)
-                  set_state(PART:"elm.text", "visible", 0.30);
+                  set_state(PART:"elm.text", st, 0.30);
                 else if (get_int(items_number) == 3)
-                  set_state(PART:"elm.text", "visible", 0.28);
+                  set_state(PART:"elm.text", st, 0.28);
                 else if (get_int(items_number) >= 4)
                   {
                     get_state(PART:"bg", st, 30, vl);
                     if (!strcmp(st, "icon_text"))
-                      set_state(PART:"elm.text", "visible", 0.28);
+                      set_state(PART:"elm.text", st, 0.28);
                     else
-                      set_state(PART:"elm.text", "visible", 0.24);
+                      set_state(PART:"elm.text", st, 0.24);
                   }
               }
          }