add delete button on history item
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Tue, 14 Dec 2010 10:49:49 +0000 (19:49 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Tue, 14 Dec 2010 10:49:49 +0000 (19:49 +0900)
CMakeLists.txt
data/images/old/05_delete.png [moved from data/images/05_delete.png with 100% similarity]
data/themes/extstyles.edc
src/clipdrawer.c

index 382473c..57f4dc3 100755 (executable)
@@ -41,6 +41,5 @@ ADD_DEPENDENCIES(${PROJECT_NAME} cbhmdrawer.edj)
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/data/themes/cbhmdrawer.edj DESTINATION share/edje)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/data/images/05_delete.png DESTINATION share/icon/cbhm)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/data/images/cbhm_default_img.png DESTINATION share/icon/cbhm)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/data/init_script/cbhm DESTINATION /etc/init.d PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
index f4e369e..09caabe 100644 (file)
@@ -1,7 +1,214 @@
+////////////////////////////////////////////////////////////////////////////////
+       group { 
+               name: "elm/check/base/extended/itemcheck";
+               images {
+                       image: "clipboard_button_delete.png" COMP;
+                       image: "clipboard_button_delete_press.png" COMP;
+               }
+               parts {
+                       part { 
+                               name: "bg";
+                               mouse_events: 1;
+                               scale: 1;
+                               type: RECT;
+                               description { state: "default" 0.0;
+                                       rel2.relative: 0.0 1.0;
+                                       fixed: 1 0;
+                                       align: 0.0 0.5;
+                                       min: 122 32;
+                                       max: 122 32;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "bg2";
+                               type: RECT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel2.relative: 1.0 1.0;
+                                       align: 0.95 0.01;
+                                       min: 46 40;
+                                       max: 46 40;
+                                       color:  0 0 0 0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "pressed" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                               description {
+                                       state: "disabled" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+               part { name: "check";
+                               mouse_events: 0;
+                               scale: 1;
+                               description { state: "default" 0.0;
+                                       rel1.to: "bg2";
+                                       rel2.to: "bg2";
+                                       visible: 1;
+                                       image {
+                                               normal: "clipboard_button_delete.png";
+                                               //border: 16 12 14 14;
+                                               //middle: 1;
+                                               //border_scale: 1;
+                                       }
+                               }
+                               description { state: "visible" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                               //              normal: "00_check_on.png";
+                                       }
+                               }
+                               description { state: "pressed" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                                               normal: "clipboard_button_delete_press.png";
+                                       }
+                               }
+                               description { state: "visible_pressed" 0.0;
+                                       inherit: "default" 0.0;
+                                       image {
+                               //              normal: "00_check_on_press.png";
+                                       }
+                               }
+                       }
+                       part { name: "elm.swallow.content";
+                               type: SWALLOW;
+                               description { state: "default" 0.0;
+                                       fixed: 1 0;
+                                       visible: 0;
+                                       color: 255 255 255 255;
+                                       align: 0.0 0.5;
+                                       rel1.to_x: "bg";
+                                       rel1.relative: 1.0 0.0;
+                                       rel1.offset: 1 1;
+                                       rel2.to_x: "bg";
+                                       rel2.relative: 1.0 1.0;
+                                       rel2.offset: 2 -2;
+                               }
+                               description { state: "visible" 0.0;
+                                       inherit: "default" 0.0;
+                                       fixed: 1 1;
+                                       visible: 1;
+                                       aspect: 1.0 1.0;
+                                       aspect_preference: VERTICAL;
+                               }
+                               description { state: "disabled" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 128 128 128 128;
+                               }
+                               description { state: "disabled_visible" 0.0;
+                                       inherit: "default" 0.0;
+                                       color: 128 128 128 128;
+                                       fixed: 1 1;
+                                       visible: 1;
+                                       aspect: 1.0 1.0;
+                               }
+                       }
+                       part { name: "events";
+                               type: RECT;
+                               ignore_flags: ON_HOLD;
+                               description { state: "default" 0.0;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part { name: "disabler";
+                               type: RECT;
+                               description { state: "default" 0.0;
+                                       color: 0 0 0 0;
+                                       visible: 0;                             
+                               }
+                               description { state: "disabled" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                                       color: 0 0 0 128;
+                               }
+                       }
+               }
+               programs {
+                       program { name: "click";
+                               signal: "mouse,up,1";
+                               source: "events";
+                               action: SIGNAL_EMIT "elm,action,check,toggle" "";
+                       }
+                       program { name: "pressed";
+                               signal: "mouse,down,1";
+                               source: "events";
+                               script {
+                                       new st[31];
+                                       new Float:vl;
+                                       get_state(PART:"check", st, 30, vl);
+                                       if (!strcmp(st, "visible"))
+                                               set_state(PART:"check", "visible_pressed", 0.0);
+                                       else if (!strcmp(st, "default"))
+                                               set_state(PART:"check", "pressed", 0.0);
+                               }               
+                       }
+                       program { name: "mouseout";
+                               signal: "mouse,out";
+                               source: "events";
+                               after: "bg_check_normal";
+                       }
+                       program { name: "bg_check_normal";
+                               script {
+                                       new st[31];
+                                       new Float:vl;
+                                       get_state(PART:"check", st, 30, vl);
+                                       if (!strcmp(st, "pressed"))
+                                               set_state(PART:"check", "default", 0.0);
+                                       else if (!strcmp(st, "visible_pressed"))
+                                               set_state(PART:"check", "visible", 0.0);
+                               }               
+                       }
+                       program { name: "check_on";
+                               signal: "elm,state,check,on";
+                               source: "elm";
+                               action:  STATE_SET "visible" 0.0;
+                               target: "check";
+                       }
+                       program { name: "check_off";
+                               signal: "elm,state,check,off";
+                               source: "elm";
+                               action:  STATE_SET "default" 0.0;
+                               target: "check";
+                       }
+                       program { name: "icon_show";
+                               signal: "elm,state,icon,visible";
+                               source: "elm";
+                               action:  STATE_SET "visible" 0.0;
+                               target: "elm.swallow.content";
+                       }
+                       program { name: "icon_hide";
+                               signal: "elm,state,icon,hidden";
+                               source: "elm";
+                               action:  STATE_SET "default" 0.0;
+                               target: "elm.swallow.content";
+                       }
+                       program { name: "disable";
+                               signal: "elm,state,disabled";
+                               source: "elm";
+                               action: STATE_SET "disabled" 0.0;
+                               target: "disabler";
+                       }
+                       program { name: "enable";
+                               signal: "elm,state,enabled";
+                               source: "elm";
+                               action: STATE_SET "default" 0.0;
+                               target: "disabler";
+                       }
+               }
+       }
+
        group {
                name: "elm/check/base/extended/imagegrid";
                images {
-                       image: "05_delete.png" COMP;
+                       image: "clipboard_button_delete.png" COMP;
+                       image: "clipboard_button_delete_press.png" COMP;
                }
 
                parts {
                                        rel1.to: "bg2";
                                        rel2.to: "bg2";
                                        visible: 0;
-                                       image.normal: "05_delete.png";
+                                       image.normal: "clipboard_button_delete.png";
                                }
                                description {
                                                state: "visible" 0.0;
                                description {
                                        state: "pressed" 0.0;
                                        inherit: "default" 0.0;
-                                       visible: 1;
+                                       visible: 0;
                                }
                                description {
                                        state: "disabled_visible" 0.0;
index 04b588b..6175099 100644 (file)
@@ -267,16 +267,14 @@ Evas_Object* _grid_icon_get(const void *data, Evas_Object *obj, const char *part
 
 //             return icon;
        }
-/*
-       else if (!strcmp(part, "elm.swallow.end") && delete_mode)
+       else if (!strcmp(part, "elm.swallow.end") /*&& delete_mode*/)
        {
                ti->delbtn = elm_check_add(obj);
-               elm_object_style_set(ti->delbtn, "extended/imagegrid");
+               elm_object_style_set(ti->delbtn, "extended/itemcheck");
                elm_check_state_set(ti->delbtn, EINA_TRUE);
                evas_object_show(ti->delbtn);
                return ti->delbtn;
        }
-*/
           
        return NULL;
 }
@@ -481,6 +479,7 @@ int clipdrawer_add_item(char *idata, int type)
 
        if (igl_counter >= HISTORY_QUEUE_MAX_ITEMS)
        {
+               // FIXME: add routine that is removing its elements
                elm_gengrid_item_del(eina_list_data_get(eina_list_last(igl)));
        }
 
@@ -576,7 +575,7 @@ int clipdrawer_create_view(void *data)
 
        // for debug
        // at starting, showing app view
-       // clipdrawer_activate_view(ad);
+       clipdrawer_activate_view(ad);
 
        return 0;
 }