discomfitor pushed a commit to branch master.

http://git.enlightenment.org/tools/examples.git/commit/?id=9f351d1f28356f3f6c91b785a88abc6fd2341d48

commit 9f351d1f28356f3f6c91b785a88abc6fd2341d48
Author: Xavi Artigas <[email protected]>
Date:   Fri Aug 10 09:38:46 2018 -0400

    tutorial: Fix behavior of "New" button in texteditor
    
    Summary:
    When "New" is pressed, the button should become disabled, because
    the file is empty and there is nothing to lose. The "New" button
    should only be enabled when there is text to lose by pressing it.
    
    Otherwise, there is no way in the code to disable the button except
    at startup, which does not make much sense.
    
    Reviewers: ajwillia.ms, zmike, bu5hm4n
    
    Reviewed By: ajwillia.ms
    
    Tags: #examples
    
    Differential Revision: https://phab.enlightenment.org/D6512
---
 apps/c/texteditor/src/texteditor_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/c/texteditor/src/texteditor_main.c 
b/apps/c/texteditor/src/texteditor_main.c
index 0c09d206..824c6e80 100644
--- a/apps/c/texteditor/src/texteditor_main.c
+++ b/apps/c/texteditor/src/texteditor_main.c
@@ -16,7 +16,7 @@ static void
 _gui_new_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
 {
    efl_text_set(_editor, "");
-   _edited = EINA_TRUE;
+   _edited = EINA_FALSE;
    _gui_toolbar_refresh();
 }
 

-- 


Reply via email to