summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Popov <artem.popov@samsung.com>2012-06-29 10:03:27 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-29 10:03:27 +0000
commit754ac901b17fbae57847326f6d372849300f0b24 (patch)
treefd71f7333c2553c38533d4f2e78b905a6d20100a
parent347c2e1a2ac6967b4d007ea3f1bcff8ceb527327 (diff)
From: Artem Popov <artem.popov@samsung.com>
Subject: [E-devel] Fwd: [Patch] elm_toolbar add signals patch. For new style of toolbar (align icon and text to center of item) are necessary some signals ("elm,state,text,visible", "elm,state,text,hidden", "elm,state,icon,visible", "elm,state,icon,hidden") New style for toolbar, where icon and text are align to center of item. SVN revision: 73028
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog6
-rw-r--r--data/themes/widgets/toolbar.edc698
-rw-r--r--src/lib/elm_toolbar.c18
4 files changed, 720 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index f2210dd51..a4fb364f6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -59,3 +59,4 @@ Jérôme Pinot <ngc891@gmail.com>
59Davide Andreoli (davemds) <dave@gurumeditation.it> 59Davide Andreoli (davemds) <dave@gurumeditation.it>
60Michal Pakula vel Rutka <m.pakula@samsung.com> 60Michal Pakula vel Rutka <m.pakula@samsung.com>
61Thiep Ha <thiep.ha@samsung.com> 61Thiep Ha <thiep.ha@samsung.com>
62Artem Popov <artem.popov@samsung.com>
diff --git a/ChangeLog b/ChangeLog
index ffce4cca2..9376ea034 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -235,3 +235,9 @@
2352012-06-27 Daniel Juyung Seo (SeoZ) 2352012-06-27 Daniel Juyung Seo (SeoZ)
236 236
237 * Genlist: Fixed homogeneous mode bug with ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY item. Now it calculates display only item size correctly. 237 * Genlist: Fixed homogeneous mode bug with ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY item. Now it calculates display only item size correctly.
238
2392012-06-29 Artem Popov
240
241 * Add support for a new toolbar style with icon and text
242 aligned in center. "item_centered".
243
diff --git a/data/themes/widgets/toolbar.edc b/data/themes/widgets/toolbar.edc
index 209f6b055..be939a4e3 100644
--- a/data/themes/widgets/toolbar.edc
+++ b/data/themes/widgets/toolbar.edc
@@ -1,3 +1,8 @@
1#define ITEM_STATE_ENABLED 0
2#define ITEM_STATE_DISABLED 1
3
4#define BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC 32 32
5
1group { name: "elm/toolbar/base/default"; 6group { name: "elm/toolbar/base/default";
2 images { 7 images {
3 image: "bt_dis_base.png" COMP; 8 image: "bt_dis_base.png" COMP;
@@ -834,6 +839,699 @@ group { name: "elm/toolbar/item/item_horizontal";
834 } 839 }
835} 840}
836 841
842group { name: "elm/toolbar/item/item_centered";
843 images {
844 image: "toolbar_sel.png" COMP;
845 }
846 data.item: "transition_animation_on" "1";
847 script {
848 public item_state = ITEM_STATE_ENABLED;
849 }
850 parts {
851 part { name: "label2";
852 type: TEXT;
853 mouse_events: 0;
854 scale: 1;
855 clip_to: "elm.text.clipper";
856 description { state: "default" 0.0;
857 align: 0.5 0.5;
858 fixed: 0 1;
859 rel1.to: "elm.text";
860 rel2.to: "elm.text";
861 color: 0 0 0 255;
862 text {
863 font: "Sans";
864 text_source: "elm.text";
865 size: 10;
866 min: 1 1;
867 align: 0.5 0.5;
868 text_class: "toolbar_item";
869 }
870 }
871 description { state: "selected" 0.0;
872 inherit: "default" 0.0;
873 visible: 0;
874 }
875 description { state: "disabled" 0.0;
876 inherit: "default" 0.0;
877 color: 0 0 0 128;
878 color3: 0 0 0 0;
879 }
880 description { state: "disabled_visible" 0.0;
881 inherit: "default" 0.0;
882 color: 0 0 0 128;
883 color3: 0 0 0 0;
884 visible: 1;
885 text.min: 1 1;
886 }
887 }
888 part { name: "label2_new";
889 type: TEXT;
890 mouse_events: 0;
891 scale: 1;
892 clip_to: "elm.text_new.clipper";
893 description { state: "default" 0.0;
894 align: 0.5 0.5;
895 fixed: 0 1;
896 rel1.to: "elm.text_new";
897 rel2.to: "elm.text_new";
898 color: 0 0 0 255;
899 text {
900 font: "Sans";
901 text_source: "elm.text_new";
902 size: 10;
903 min: 1 1;
904 align: 0.5 0.5;
905 text_class: "toolbar_item";
906 }
907 }
908 description { state: "selected" 0.0;
909 inherit: "default" 0.0;
910 visible: 0;
911 }
912 description { state: "disabled" 0.0;
913 inherit: "default" 0.0;
914 color: 0 0 0 128;
915 color3: 0 0 0 0;
916 }
917 description { state: "disabled_visible" 0.0;
918 inherit: "default" 0.0;
919 color: 0 0 0 128;
920 color3: 0 0 0 0;
921 visible: 1;
922 text.min: 1 1;
923 }
924 }
925 part { name: "bg";
926 mouse_events: 0;
927 description { state: "default" 0.0;
928 visible: 0;
929 color: 255 255 255 0;
930 rel1 {
931 relative: 0.0 0.0;
932 offset: 2 2;
933 }
934 rel2 {
935 relative: 1.0 1.0;
936 offset: -2 -3;
937 }
938 image {
939 normal: "toolbar_sel.png";
940 border: 3 3 3 3;
941 }
942 image.middle: SOLID;
943 fill.smooth: 0;
944 }
945 description { state: "selected" 0.0;
946 inherit: "default" 0.0;
947 visible: 1;
948 color: 255 255 255 255;
949 }
950 description { state: "disabled" 0.0;
951 inherit: "default" 0.0;
952 visible: 0;
953 color: 255 255 255 0;
954 }
955 }
956 part { name: "padding_left_top";
957 type: RECT;
958 scale: 1;
959 mouse_events: 0;
960 description { state: "default" 0.0;
961 align: 0.0 0.0;
962 rel2.relative: 0.0 0.0;
963 min: 10 8;
964 fixed: 1 1;
965 visible: 1;
966 color: 0 0 0 0;
967 }
968 }
969 part { name: "padding_right_bottom";
970 type: RECT;
971 scale: 1;
972 mouse_events: 0;
973 description { state: "default" 0.0;
974 align: 1.0 1.0;
975 rel1.relative: 1.0 1.0;
976 min: 10 5;
977 fixed: 1 1;
978 visible: 1;
979 color: 0 0 0 0;
980 }
981 }
982 part {
983 name: "icon_rect";
984 type: RECT;
985 scale: 1;
986 mouse_events: 0;
987 description { state: "default" 0.0;
988 min: 0 0;
989 fixed: 0 1;
990 rel1 {
991 relative: 1.0 1.0;
992 to: "padding_left_top";
993 }
994 rel2 {
995 relative: 0.0 1.0;
996 to_x: "padding_right_bottom";
997 to_y: "padding_left_top";
998 }
999 align: 0.5 0.0;
1000 color: 0 0 0 0;
1001 }
1002 description { state: "visible" 0.0;
1003 min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1004 fixed: 0 1;
1005 rel1 {
1006 relative: 1.0 1.0;
1007 to: "padding_left_top";
1008 }
1009 rel2 {
1010 relative: 0.0 1.0;
1011 to_x: "padding_right_bottom";
1012 to_y: "padding_left_top";
1013 }
1014 align: 0.5 0.0;
1015 color: 0 0 0 0;
1016 }
1017 description { state: "icononly" 0.0;
1018 inherit: "default" 0.0;
1019 }
1020 }
1021 part { name: "padding_after_icon";
1022 type: RECT;
1023 scale: 1;
1024 mouse_events: 0;
1025 description { state: "default" 0.0; //when only icon or no icon is there
1026 align: 0.0 0.0;
1027 rel1 {
1028 relative: 0.0 1.0;
1029 to: "icon_rect";
1030 }
1031 rel2.to: "icon_rect";
1032 fixed: 0 1;
1033 min: 0 0;
1034 color: 0 0 0 0;
1035 }
1036 description { state: "visible" 0.0;
1037 inherit: "default" 0.0;
1038 }
1039 description { state: "icononly" 0.0;
1040 inherit: "default" 0.0;
1041 }
1042 }
1043 part { name: "padding_before_text";
1044 type: RECT;
1045 scale: 1;
1046 mouse_events: 0;
1047 description { state: "default" 0.0; //when only icon or no icon is there
1048 align: 0.5 1.0;
1049 rel1 {
1050 relative: 1.0 0.0;
1051 to_x: "padding_left_top";
1052 to_y: "elm.text";
1053 }
1054 rel2 {
1055 relative: 0.0 0.0;
1056 to_x: "padding_right_bottom";
1057 to_y: "elm.text";
1058 }
1059 fixed: 0 1;
1060 min: 0 0;
1061 color: 0 0 0 0;
1062 }
1063 }
1064 part { name: "elm.swallow.icon";
1065 type: SWALLOW;
1066 scale: 1;
1067 clip_to: "elm.icon.clipper";
1068 description { state: "default" 0.0;
1069 visible: 0;
1070 align: 0.5 0.5;
1071 rel1 {
1072 relative: 1.0 1.0;
1073 to: "padding_left_top";
1074 }
1075 rel2 {
1076 relative: 0.0 1.0;
1077 to_x: "padding_right_bottom";
1078 to_y: "padding_left_top";
1079 }
1080 // fixed: 1 1;
1081 }
1082 description { state: "visible" 0.0;
1083 // fixed: 1 1;
1084 min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1085 max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1086 rel1 {
1087 relative: 1.0 1.0;
1088 to: "padding_left_top";
1089 offset: 0 -3;
1090 }
1091 rel2 {
1092 relative: 0.0 0.0;
1093 to: "padding_right_bottom";
1094 offset: 0 -10;
1095 }
1096 aspect: 1.0 1.0;
1097 aspect_preference: BOTH;
1098 }
1099 description { state: "icononly" 0.0;
1100 min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1101 max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1102 rel1 {
1103 relative: 1.0 1.0;
1104 to: "padding_left_top";
1105 }
1106 rel2 {
1107 relative: 0.0 0.0;
1108 to: "padding_right_bottom";
1109 }
1110 aspect: 1.0 1.0;
1111 aspect_preference: BOTH;
1112 }
1113 }
1114 part { name: "elm.swallow.icon_new";
1115 type: SWALLOW;
1116 scale: 1;
1117 clip_to: "elm.icon_new.clipper";
1118 description { state: "default" 0.0;
1119 visible: 0;
1120 align: 0.5 0.5;
1121 rel1 {
1122 relative: 1.0 1.0;
1123 to: "padding_left_top";
1124 }
1125 rel2 {
1126 relative: 0.0 1.0;
1127 to_x: "padding_right_bottom";
1128 to_y: "padding_left_top";
1129 }
1130 // fixed: 1 1;
1131 }
1132 description { state: "visible" 0.0;
1133 // fixed: 1 1;
1134 min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1135 max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1136 rel1 {
1137 relative: 1.0 1.0;
1138 to: "padding_left_top";
1139 offset: 0 -3;
1140 }
1141 rel2 {
1142 relative: 0.0 0.0;
1143 to: "padding_right_bottom";
1144 offset: 0 -10;
1145 }
1146 aspect: 1.0 1.0;
1147 aspect_preference: BOTH;
1148 }
1149 description { state: "icononly" 0.0;
1150 min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1151 max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC;
1152 rel1 {
1153 relative: 1.0 1.0;
1154 to: "padding_left_top";
1155 }
1156 rel2 {
1157 relative: 0.0 0.0;
1158 to: "padding_right_bottom";
1159 }
1160 aspect: 1.0 1.0;
1161 aspect_preference: BOTH;
1162 }
1163 }
1164 part { name: "elm.text";
1165 type: TEXT;
1166 effect: SOFT_SHADOW;
1167 mouse_events: 0;
1168 scale: 1;
1169 clip_to: "elm.text.clipper";
1170 description { state: "default" 0.0;
1171 align: 0.5 0.5;
1172 fixed: 0 1;
1173 rel1 {
1174 relative: 1.0 1.0;
1175 to_x: "padding_left_top";
1176 to_y: "padding_after_icon";
1177 offset: 0 -3;
1178 }
1179 rel2 {
1180 relative: 0.0 0.0;
1181 to: "padding_right_bottom";
1182 offset: 0 -3;
1183 }
1184 visible: 0;
1185 color: 224 224 224 255;
1186 color3: 0 0 0 32;
1187 text {
1188 font: "Sans:style=Bold";
1189 size: 10;
1190 min: 1 1;
1191 align: 0.5 0.5;
1192 text_class: "toolbar_item";
1193 }
1194 }
1195 description { state: "selected" 0.0;
1196 inherit: "default" 0.0;
1197 visible: 1;
1198 }
1199 description { state: "visible" 0.0;
1200 inherit: "default" 0.0;
1201 visible: 1;
1202 text.min: 1 1;
1203 }
1204 description { state: "disabled" 0.0;
1205 inherit: "default" 0.0;
1206 color: 0 0 0 128;
1207 color3: 0 0 0 0;
1208 }
1209 description { state: "disabled_visible" 0.0;
1210 inherit: "default" 0.0;
1211 color: 0 0 0 128;
1212 color3: 0 0 0 0;
1213 visible: 1;
1214 text.min: 1 1;
1215 }
1216 }
1217 part { name: "elm.text_new";
1218 type: TEXT;
1219 effect: SOFT_SHADOW;
1220 mouse_events: 0;
1221 clip_to: "elm.text_new.clipper";
1222 scale: 1;
1223 description { state: "default" 0.0;
1224 align: 0.5 0.5;
1225 fixed: 0 1;
1226 rel1 {
1227 relative: 1.0 1.0;
1228 to_x: "padding_left_top";
1229 to_y: "padding_after_icon";
1230 offset: 0 -3;
1231 }
1232 rel2 {
1233 relative: 0.0 0.0;
1234 to: "padding_right_bottom";
1235 offset: 0 -3;
1236 }
1237 visible: 0;
1238 color: 224 224 224 255;
1239 color3: 0 0 0 32;
1240 text {
1241 font: "Sans:style=Bold";
1242 size: 10;
1243 min: 1 1;
1244 align: 0.5 0.5;
1245 text_class: "toolbar_item";
1246 }
1247 }
1248 description { state: "selected" 0.0;
1249 inherit: "default" 0.0;
1250 visible: 1;
1251 }
1252 description { state: "visible" 0.0;
1253 inherit: "default" 0.0;
1254 visible: 1;
1255 text.min: 1 1;
1256 }
1257 description { state: "disabled" 0.0;
1258 inherit: "default" 0.0;
1259 color: 0 0 0 128;
1260 color3: 0 0 0 0;
1261 }
1262 description { state: "disabled_visible" 0.0;
1263 inherit: "default" 0.0;
1264 color: 0 0 0 128;
1265 color3: 0 0 0 0;
1266 visible: 1;
1267 text.min: 1 1;
1268 }
1269 }
1270 part { name: "elm.text.clipper";
1271 type: RECT;
1272 description { state: "default" 0.0;
1273 color: 255 255 255 255;
1274 }
1275 description { state: "animation" 0.0;
1276 color: 255 255 255 0;
1277 }
1278 description { state: "disabled" 0.0;
1279 color: 255 255 255 153;
1280 }
1281 }
1282 part { name: "elm.text_new.clipper";
1283 type: RECT;
1284 description { state: "default" 0.0;
1285 color: 255 255 255 0;
1286 }
1287 description { state: "animation" 0.0;
1288 color: 255 255 255 255;
1289 }
1290 description { state: "disabled" 0.0;
1291 color: 255 255 255 153;
1292 }
1293 }
1294 part { name: "elm.icon.clipper";
1295 type: RECT;
1296 description { state: "default" 0.0;
1297 color: 255 255 255 255;
1298 }
1299 description { state: "animation" 0.0;
1300 color: 255 255 255 0;
1301 }
1302 description { state: "disabled" 0.0;
1303 color: 255 255 255 153;
1304 }
1305 }
1306 part { name: "elm.icon_new.clipper";
1307 type: RECT;
1308 description { state: "default" 0.0;
1309 color: 255 255 255 0;
1310 }
1311 description { state: "animation" 0.0;
1312 color: 255 255 255 255;
1313 }
1314 description { state: "disabled" 0.0;
1315 color: 255 255 255 153;
1316 }
1317 }
1318 part { name: "event";
1319 type: RECT;
1320 mouse_events: 1;
1321 ignore_flags: ON_HOLD;
1322 description { state: "default" 0.0;
1323 color: 0 0 0 0;
1324 }
1325 }
1326 part { name: "event2";
1327 type: RECT;
1328 mouse_events: 1;
1329 repeat_events: 1;
1330 description { state: "default" 0.0;
1331 color: 0 0 0 0;
1332 }
1333 }
1334 }
1335 programs {
1336 program { name: "pressed";
1337 signal: "mouse,down,1";
1338 source: "event";
1339 script {
1340 if (get_int(item_state) != ITEM_STATE_DISABLED)
1341 {
1342 set_state(PART:"elm.text", "visible", 0.0);
1343 set_state(PART:"elm.text_new", "visible", 0.0);
1344 set_state(PART:"bg", "selected", 0.0);
1345 }
1346 }
1347 transition: LINEAR 0.2;
1348 }
1349 program { name: "unpressed";
1350 signal: "mouse,up,1";
1351 source: "event2";
1352 action: STATE_SET "default" 0.0;
1353 target: "bg";
1354 target: "elm.text";
1355 target: "elm.text_new";
1356 transition: LINEAR 0.1;
1357 }
1358 program { name: "go";
1359 signal: "mouse,up,1";
1360 source: "event";
1361 action: SIGNAL_EMIT "elm,action,click" "elm";
1362 }
1363 program { name: "mouse,in";
1364 signal: "mouse,in";
1365 source: "event";
1366 action: SIGNAL_EMIT "elm,mouse,in" "elm";
1367 }
1368 program { name: "mouse,out";
1369 signal: "mouse,out";
1370 source: "event";
1371 action: SIGNAL_EMIT "elm,mouse,out" "elm";
1372 }
1373 program { name: "disable";
1374 signal: "elm,state,disabled";
1375 source: "elm";
1376 script {
1377 set_int(item_state, ITEM_STATE_DISABLED);
1378 set_state(PART:"bg", "disabled", 0.0);
1379 set_state(PART:"elm.text.clipper", "disabled", 0.0);
1380 set_state(PART:"elm.icon.clipper", "disabled", 0.0);
1381 run_program(PROGRAM:"label_set,animation,done");
1382 run_program(PROGRAM:"icon_set,animation,done");
1383 }
1384 }
1385 program { name: "enable";
1386 signal: "elm,state,enabled";
1387 source: "elm";
1388 script {
1389 set_int(item_state, ITEM_STATE_ENABLED);
1390 set_state(PART:"bg", "default", 0.0);
1391 set_state(PART:"elm.text.clipper", "default", 0.0);
1392 set_state(PART:"elm.icon.clipper", "default", 0.0);
1393 run_program(PROGRAM:"label_set,animation,done");
1394 run_program(PROGRAM:"icon_set,animation,done");
1395 }
1396 }
1397 program { name: "label_set,animation,forward";
1398 signal: "elm,state,label_set,forward";
1399 source: "elm";
1400 after: "label_set,animation";
1401 }
1402 program { name: "label_set,animation,backward";
1403 signal: "elm,state,label_set,backward";
1404 source: "elm";
1405 after: "label_set,animation";
1406 }
1407 program { name: "label_set,animation";
1408 signal: "elm,state,label_set";
1409 source: "elm";
1410 action: STATE_SET "animation" 0.0;
1411 target: "elm.text.clipper";
1412 target: "elm.text_new.clipper";
1413 transition: LINEAR 0.2;
1414 after: "label_set,animation,done";
1415 }
1416 program { name: "label_set,animation,done";
1417 action: SIGNAL_EMIT "elm,state,label_set,done" "elm";
1418 }
1419 program { name: "label,reset";
1420 signal: "elm,state,label,reset";
1421 source: "elm";
1422 script {
1423 set_state(PART:"elm.text_new.clipper", "default", 0.0);
1424 if (get_int(item_state) != ITEM_STATE_DISABLED)
1425 set_state(PART:"elm.text.clipper", "default", 0.0);
1426 else
1427 set_state(PART:"elm.text.clipper", "disabled", 0.0);
1428 }
1429 }
1430 program { name: "icon_set,animation,forward";
1431 signal: "elm,state,icon_set,forward";
1432 source: "elm";
1433 after: "icon_set,animation";
1434 }
1435 program { name: "icon_set,animation,backward";
1436 signal: "elm,state,icon_set,backward";
1437 source: "elm";
1438 after: "icon_set,animation";
1439 }
1440 program { name: "icon_set,animation";
1441 signal: "elm,state,icon_set";
1442 source: "elm";
1443 action: STATE_SET "animation" 0.0;
1444 target: "elm.icon.clipper";
1445 target: "elm.icon_new.clipper";
1446 transition: LINEAR 0.2;
1447 after: "icon_set,animation,done";
1448 }
1449 program { name: "icon_set,animation,done";
1450 action: SIGNAL_EMIT "elm,state,icon_set,done" "elm";
1451 }
1452 program { name: "icon,reset";
1453 signal: "elm,state,icon,reset";
1454 source: "elm";
1455 script {
1456 set_state(PART:"elm.icon_new.clipper", "default", 0.0);
1457 if (get_int(item_state) != ITEM_STATE_DISABLED)
1458 set_state(PART:"elm.icon.clipper", "default", 0.0);
1459 else
1460 set_state(PART:"elm.icon.clipper", "disabled", 0.0);
1461 }
1462 }
1463 program { name: "text_show";
1464 signal: "elm,state,text,visible";
1465 source: "elm";
1466 script {
1467 new st[31];
1468 new Float:vl;
1469 get_state(PART:"elm.swallow.icon", st, 30, vl);
1470 if (!strcmp(st, "icononly"))
1471 {
1472 set_state(PART:"elm.swallow.icon", "visible", 0.0);
1473 set_state(PART:"icon_rect", "visible", 0.0);
1474 set_state(PART:"padding_after_icon", "visible", 0.0);
1475 }
1476 set_state(PART:"label2", "visible", 0.0);
1477 }
1478 }
1479 program { name: "text_hide";
1480 signal: "elm,state,text,hidden";
1481 source: "elm";
1482 script {
1483 new st[31];
1484 new Float:vl;
1485 get_state(PART:"elm.swallow.icon", st, 30, vl);
1486 if (!strcmp(st, "visible"))
1487 {
1488 set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1489 set_state(PART:"icon_rect", "icononly", 0.0);
1490 set_state(PART:"padding_after_icon", "icononly", 0.0);
1491 }
1492 set_state(PART:"label2", "default", 0.0);
1493 }
1494 }
1495 program { name: "icon_show";
1496 signal: "elm,state,icon,visible";
1497 source: "elm";
1498 script {
1499 new st[31];
1500 new Float:vl;
1501 get_state(PART:"elm.text", st, 30, vl);
1502 if (!strcmp(st, "visible"))
1503 {
1504 set_state(PART:"elm.swallow.icon", "visible", 0.0);
1505 set_state(PART:"icon_rect", "visible", 0.0);
1506 set_state(PART:"padding_after_icon", "visible", 0.0);
1507 }
1508 else
1509 {
1510 set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1511 set_state(PART:"icon_rect", "icononly", 0.0);
1512 set_state(PART:"padding_after_icon", "icononly", 0.0);
1513 }
1514 }
1515 }
1516 program { name: "icon_hide";
1517 signal: "elm,state,icon,hidden";
1518 source: "elm";
1519 script {
1520 new st[31];
1521 new Float:vl;
1522 get_state(PART:"elm.text", st, 30, vl);
1523 if (!strcmp(st, "visible"))
1524 {
1525 set_state(PART:"label2", "visible", 0.0);
1526 }
1527 set_state(PART:"elm.swallow.icon", "default", 0.0);
1528 set_state(PART:"icon_rect", "default", 0.0);
1529 set_state(PART:"padding_after_icon", "default", 0.0);
1530 }
1531 }
1532 }
1533}
1534
837group { name: "elm/toolbar/separator/default"; 1535group { name: "elm/toolbar/separator/default";
838 images { 1536 images {
839 image: "toolbar_separator_v.png" COMP; 1537 image: "toolbar_separator_v.png" COMP;
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index c0a279f7a..fb3bc7337 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -288,8 +288,13 @@ _item_del(Elm_Toolbar_Item *it)
288 free(it_state); 288 free(it_state);
289 } 289 }
290 eina_stringshare_del(it->label); 290 eina_stringshare_del(it->label);
291 if (it->label) edje_object_signal_emit(VIEW(it), "elm,state,text,hidden", "elm");
291 eina_stringshare_del(it->icon_str); 292 eina_stringshare_del(it->icon_str);
292 if (it->icon) evas_object_del(it->icon); 293 if (it->icon)
294 {
295 edje_object_signal_emit(VIEW(it), "elm,state,icon,hidden", "elm");
296 evas_object_del(it->icon);
297 }
293 if (it->object) evas_object_del(it->object); 298 if (it->object) evas_object_del(it->object);
294 //TODO: See if checking for wd->menu_parent is necessary before deleting menu 299 //TODO: See if checking for wd->menu_parent is necessary before deleting menu
295 if (it->o_menu) evas_object_del(it->o_menu); 300 if (it->o_menu) evas_object_del(it->o_menu);
@@ -499,7 +504,7 @@ _item_content_unset_hook(Elm_Object_Item *it, const char *part)
499 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it; 504 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
500 Evas_Object *obj = WIDGET(item); 505 Evas_Object *obj = WIDGET(item);
501 Widget_Data *wd = elm_widget_data_get(obj); 506 Widget_Data *wd = elm_widget_data_get(obj);
502 507
503 edje_object_part_unswallow(VIEW(it), item->object); 508 edje_object_part_unswallow(VIEW(it), item->object);
504 elm_widget_sub_object_del(obj, item->object); 509 elm_widget_sub_object_del(obj, item->object);
505 o = item->object; 510 o = item->object;
@@ -1066,6 +1071,7 @@ _item_reorder_start(Elm_Toolbar_Item *item)
1066 evas_object_size_hint_min_set(it->icon, ms, ms); 1071 evas_object_size_hint_min_set(it->icon, ms, ms);
1067 evas_object_size_hint_max_set(it->icon, ms, ms); 1072 evas_object_size_hint_max_set(it->icon, ms, ms);
1068 edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon); 1073 edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
1074 edje_object_signal_emit(VIEW(it), "elm,state,icon,visible", "elm"); //!!
1069 evas_object_show(it->icon); 1075 evas_object_show(it->icon);
1070 elm_widget_sub_object_add(obj, it->icon); 1076 elm_widget_sub_object_add(obj, it->icon);
1071 } 1077 }
@@ -1309,10 +1315,15 @@ _item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb f
1309 evas_object_size_hint_min_set(it->icon, ms, ms); 1315 evas_object_size_hint_min_set(it->icon, ms, ms);
1310 evas_object_size_hint_max_set(it->icon, ms, ms); 1316 evas_object_size_hint_max_set(it->icon, ms, ms);
1311 edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon); 1317 edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
1318 edje_object_signal_emit(VIEW(it), "elm,state,icon,visible", "elm");
1312 evas_object_show(it->icon); 1319 evas_object_show(it->icon);
1313 elm_widget_sub_object_add(obj, it->icon); 1320 elm_widget_sub_object_add(obj, it->icon);
1314 } 1321 }
1315 edje_object_part_text_escaped_set(VIEW(it), "elm.text", it->label); 1322 if (it->label)
1323 {
1324 edje_object_part_text_escaped_set(VIEW(it), "elm.text", it->label);
1325 edje_object_signal_emit(VIEW(it), "elm,state,text,visible", "elm");
1326 }
1316 mw = mh = -1; 1327 mw = mh = -1;
1317 if (!it->separator && !it->object) 1328 if (!it->separator && !it->object)
1318 elm_coords_finger_size_adjust(1, &mw, 1, &mh); 1329 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
@@ -1352,6 +1363,7 @@ _elm_toolbar_item_label_update(Elm_Toolbar_Item *item)
1352 Evas_Coord mw = -1, mh = -1, minw = -1, minh = -1; 1363 Evas_Coord mw = -1, mh = -1, minw = -1, minh = -1;
1353 Widget_Data *wd = elm_widget_data_get(WIDGET(item)); 1364 Widget_Data *wd = elm_widget_data_get(WIDGET(item));
1354 edje_object_part_text_escaped_set(VIEW(item), "elm.text", item->label); 1365 edje_object_part_text_escaped_set(VIEW(item), "elm.text", item->label);
1366 edje_object_signal_emit(VIEW(item), "elm,state,text,visible", "elm");
1355 1367
1356 elm_coords_finger_size_adjust(1, &mw, 1, &mh); 1368 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1357 edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh); 1369 edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);