Hello everyone.

Attached patch fixes a couple issues with current typebuf in EFM.
First, now typebuf is cleared out when you change current directory.
Second, it has a 5 seconds timeout, so if you don't type anything
during this time, it's cleared out too.

PS: Typebuf is a way for faster navigation in EFM, you type what you
what to find, and matching file is automatically selected.

-- 
King regards,
Fedor Gusev.
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index 4ede60e..b2c0ca8 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -97,6 +97,7 @@ struct _E_Fm2_Smart_Data
    
    struct {
       char            *buf;
+      Ecore_Timer     *timer;
    } typebuf;
    
    int                 busy_count;
@@ -596,6 +597,9 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
 	_e_fm2_client_monitor_add(sd->id, sd->realpath);
 	sd->listing = 1;
      }
+
+   /* Clean up typebuf. */
+   _e_fm2_typebuf_hide(obj);
    
    evas_object_smart_callback_call(obj, "dir_changed", NULL);
    sd->tmp.iter = 0;
@@ -4373,6 +4377,24 @@ _e_fm2_typebuf_complete(Evas_Object *obj)
    _e_fm2_typebuf_match(obj);
 }
 
+static int
+_e_fm_typebuf_timer_cb(void *data)
+{
+   Evas_Object *obj = data;
+   E_Fm2_Smart_Data *sd;
+
+   if(!data) return 0;
+   sd = evas_object_smart_data_get(obj);
+   if (!sd) return 0;
+
+   if (!sd->typebuf_visible) return 0;
+
+   _e_fm2_typebuf_hide(obj);
+   sd->typebuf.timer = NULL;
+
+   return 0;
+}
+
 static void
 _e_fm2_typebuf_char_append(Evas_Object *obj, const char *ch)
 {
@@ -4390,6 +4412,13 @@ _e_fm2_typebuf_char_append(Evas_Object *obj, const char *ch)
    sd->typebuf.buf = ts;
    _e_fm2_typebuf_match(obj);
    edje_object_part_text_set(sd->overlay, "e.text.typebuf_label", sd->typebuf.buf);
+
+   if(sd->typebuf.timer) 
+     {
+	ecore_timer_del(sd->typebuf.timer);
+     }
+
+   sd->typebuf.timer = ecore_timer_add(5.0, _e_fm_typebuf_timer_cb, obj);
 }
 
 static void
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to