[dialoguegroup & editfield] modified for 0.7
authorWooHyun Jung <wh0705.jung@samsung.com>
Mon, 9 Aug 2010 11:30:28 +0000 (20:30 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 9 Aug 2010 11:30:28 +0000 (20:30 +0900)
src/lib/elm_dialoguegroup.c
src/lib/elm_editfield.c

index 296dc3d..b50c69a 100644 (file)
@@ -17,7 +17,7 @@ struct _Dialogue_Item
        Elm_Dialoguegroup_Item_Style style;
        const char *location;
        Eina_Bool press;
-       Eina_Bool line_show;
+//     Eina_Bool line_show;
 };
 
 
@@ -137,6 +137,7 @@ static void _set_item_theme(Dialogue_Item *item, const char *location)
                elm_layout_theme_set(item->bg_layout, "dialoguegroup", "editfield", location);
 }
 
+/*
 static void _set_line_show(Dialogue_Item *item, Dialogue_Item *after)
 {
        if(!item || !after) return;
@@ -154,6 +155,7 @@ static void _set_line_show(Dialogue_Item *item, Dialogue_Item *after)
        else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) 
                item->line_show = EINA_TRUE;    
 }
+*/
 
 static void _change_item_bg(Dialogue_Item *item, const char *location)
 {
@@ -167,8 +169,8 @@ static void _change_item_bg(Dialogue_Item *item, const char *location)
        else
                edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");    
 
-       if(item->line_show == EINA_FALSE)
-               edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");
+/*     if(item->line_show == EINA_FALSE)
+               edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");*/
                        
 }
 
@@ -184,7 +186,7 @@ static Dialogue_Item* _create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Di
        item->content = subobj;
        item->press = EINA_TRUE;
        item->style = style;
-       item->line_show = EINA_TRUE;
+//     item->line_show = EINA_TRUE;
        eina_stringshare_replace(&item->location, location);
        
        item->bg_layout = elm_layout_add(wd->parent);
@@ -269,7 +271,7 @@ elm_dialoguegroup_append(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegrou
                        _change_item_bg(item, "middle");                
                }
                new_item = _create_item(obj, subobj, style, "bottom");
-               _set_line_show(item, new_item);
+//             _set_line_show(item, new_item);
        }
        elm_box_pack_end(wd->box, new_item->bg_layout);
        wd->items = eina_list_append(wd->items, new_item);                      
@@ -309,7 +311,7 @@ elm_dialoguegroup_prepend(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegro
                        _change_item_bg(item, "middle");                
                }
                new_item = _create_item(obj, subobj, style, "top");
-               _set_line_show(new_item, item);
+//             _set_line_show(new_item, item);
        }
        if(wd->title_layout)
                elm_box_pack_after(wd->box, new_item->bg_layout, wd->title_layout);     
@@ -356,7 +358,7 @@ elm_dialoguegroup_insert_after(Evas_Object *obj, Evas_Object *subobj, Dialogue_I
 
                        elm_box_pack_after(wd->box, item->bg_layout, after_item->bg_layout);
                        wd->items = eina_list_append_relative(wd->items, item, after_item);
-                       _set_line_show(after, item);
+               //      _set_line_show(after, item);
                }               
        }
                
@@ -401,7 +403,7 @@ elm_dialoguegroup_insert_before(Evas_Object *obj, Evas_Object *subobj, Dialogue_
                        else if( !strcmp(before_item->location, "middle") || !strcmp(before_item->location, "bottom") ) {
                                item = _create_item(obj, subobj, style, "middle");
                                prev = eina_list_prev(l);
-                               _set_line_show(prev->data, item);
+                       //      _set_line_show(prev->data, item);
                        }
                        elm_box_pack_before(wd->box, item->bg_layout, before_item->bg_layout);
                        wd->items = eina_list_prepend_relative(wd->items, item, before_item);
index 74e6c8d..c1b6817 100644 (file)
@@ -1,6 +1,3 @@
-/*
- * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
- */
 #include <Elementary.h>
 #include "elm_priv.h"
 
@@ -26,7 +23,7 @@ struct _Widget_Data
    Eina_Bool needs_size_calc:1;
    Eina_Bool show_guide_text:1;
    Eina_Bool editing:1;
-   Eina_Bool single_line : 1;
+   Eina_Bool single_line:1;
 };
 
 static const char *widtype = NULL;
@@ -56,11 +53,7 @@ _on_focus_hook(void *data, Evas_Object *obj)
    if (!elm_widget_focus_get(obj) && !(elm_widget_disabled_get(obj)) ) 
      {
        wd->editing = EINA_FALSE;
-       edje_object_signal_emit(wd->base, "elm,action,unfocus", "elm");
        edje_object_signal_emit(wd->base, "elm,state,over,show", "elm");                
-       text = elm_entry_entry_get(wd->entry);
-       edje_object_part_text_set(wd->base, "elm.content.no.edit", text);
-       edje_object_signal_emit(wd->base, "elm,action,no,edit", "elm");         
        if(_empty_entry(wd->entry)) 
          {
             if(wd->guide_text) 
@@ -174,8 +167,6 @@ _entry_changed_cb(void *data, Evas_Object *obj, void* event_info)
 
    if(!_empty_entry(wd->entry)) 
      {
-       text = elm_entry_entry_get(wd->entry);
-       edje_object_part_text_set(wd->base, "elm.content.no.edit", text);               
        if(wd->guide_text) 
          {
             edje_object_signal_emit(wd->base, "elm,state,guidetext,hidden", "elm");
@@ -190,24 +181,23 @@ _signal_mouse_clicked(void *data, Evas_Object *obj, const char *emission, const
    Widget_Data *wd = elm_widget_data_get(data);
    if(!wd || !wd->base) return;
 
-   if(strcmp(source, "left_icon") && strcmp(source, "right_icon") && strcmp(source, "over_change_bg"))
+   if(!strcmp(source, "eraser"))
+     {
+       elm_entry_entry_set(wd->entry, "");                        
+     }            
+   else if(strcmp(source, "left_icon") && strcmp(source, "right_icon") && strcmp(source, "eraser"))
      {
-       edje_object_signal_emit(wd->base, "elm,action,focus", "elm");   
        edje_object_signal_emit(wd->base, "elm,state,over,hide", "elm");
-       edje_object_signal_emit(wd->base, "elm,action,edit", "elm");    
        elm_widget_focus_set(wd->entry, EINA_TRUE);                     
 
        if(wd->editing == EINA_FALSE)
          elm_entry_cursor_end_set(wd->entry);
        
-//     if(!_empty_entry(wd->entry)) 
-//       {
-            if(wd->guide_text) 
-              {
+       if(wd->guide_text) 
+          {
                  edje_object_signal_emit(wd->base, "elm,state,guidetext,hidden", "elm");
                  wd->show_guide_text = EINA_FALSE;
-              }
-//       }
+          }
        evas_object_smart_callback_call(data, "clicked", NULL);
        wd->editing = EINA_TRUE;
      }
@@ -531,5 +521,10 @@ elm_editfield_eraser_set(Evas_Object *obj, Eina_Bool visible)
    if (!wd || !wd->base)
      return;
 
-   return; // design is not supported
+   if (visible) 
+       edje_object_signal_emit(wd->base, "elm,state,eraser,show", "elm");
+   else 
+       edje_object_signal_emit(wd->base, "elm,state,eraser,hidden", "elm");
+   
+   return; 
 }