>ilLogict <[EMAIL PROTECTED]> [2005-04-18 10:17]:
>
>>> Note: This is the first ever patch I submit to a project, I don't >know
>>> if it is the way it should be, so can you please correct me and tell >me
>>> how it should be?
>
>
>echo "diff -uN" >> ~/.cvsrc
>
>then, run "cvs diff" to create the patch.
>
>--
>Regards,
>Tilman



Hello.

 Thank you very much for you kindness. I hope it did it the good way now ;)

 Cheers.

                                         ilLogict

FYI:

 Hello !

I'm attaching a patch file for ewl_entry.c (e17/libs/ewl/src/lib). The problem it *should* ;D solve is that when you clear completely an existing entry, it resizes to 1px and when you then type something, you can't view it anymore, even if it is taken in account, and even if the entry has been resized to something bigger than 1px. It is a quick and dirty patch, and I don't know if it is the way it should be corrected. I kept the 1px-resize, 'cause it's always good to know if an entry is really empty or if it is filled with blank characters.

 Can you please have a look at it?

 Cheers.


ilLogict


Note: This is the first ever patch I submit to a project, I don't know if it is the way it should be, so can you please correct me and tell me how it should be?


Note2: I tried to keep the existing coding-style...

Note3: Still have to correct bugs with cursor, checking it...
Index: ewl_entry.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v
retrieving revision 1.12
diff -u -r1.12 ewl_entry.c
--- ewl_entry.c 10 Apr 2005 05:05:17 -0000      1.12
+++ ewl_entry.c 18 Apr 2005 11:45:30 -0000
@@ -359,22 +359,28 @@
 void ewl_entry_text_insert(Ewl_Entry * e, char *text, int index)
 {
        Ewl_Entry_Op *op;
-       int len = 0;
+       int len = strlen(text);
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("e", e);
        DCHECK_PARAM_PTR("text", text);
 
-       op = ewl_entry_op_text_insert_new(text, index);
-       len = strlen(text);
-       ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor),
-                                      index + len);
-       e->length += len;
-
-       ecore_dlist_prepend(e->ops, op);
-       if (REALIZED(e))
-               ewl_entry_ops_apply(e);
+       if (ewl_entry_text_get(e)) {
+               op = ewl_entry_op_text_insert_new(text, index);
+               ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor),
+                                             index + len);
+               e->length += len;
 
+               ecore_dlist_prepend(e->ops, op);
+               if (REALIZED(e))
+                       ewl_entry_ops_apply(e);
+       }
+       else {
+               ewl_entry_text_set(e, text);
+               ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor),
+                                             len);
+       }
+       
        ewl_widget_configure(EWL_WIDGET(e));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);

Reply via email to