proclist: search clear on "escape"
This commit is contained in:
parent
9229ebed00
commit
6a2876d207
|
@ -1473,21 +1473,34 @@ _search_empty_cb(void *data)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_search_clear(Ui_Data *pd)
|
||||||
|
{
|
||||||
|
if (pd->search_text)
|
||||||
|
free(pd->search_text);
|
||||||
|
pd->search_text = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_search_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_search_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
Evas_Event_Key_Down *ev;
|
||||||
const char *text;
|
const char *text;
|
||||||
Ui_Data *pd;
|
Ui_Data *pd;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
pd = data;
|
pd = data;
|
||||||
|
ev = event_info;
|
||||||
|
|
||||||
|
if (ev && !strcmp(ev->keyname, "Escape"))
|
||||||
|
elm_object_text_set(pd->search_entry, "");
|
||||||
|
|
||||||
text = elm_object_text_get(obj);
|
text = elm_object_text_get(obj);
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
{
|
{
|
||||||
|
_search_clear(pd);
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
if (pd->search_text)
|
|
||||||
free(pd->search_text);
|
|
||||||
pd->search_text = strdup(text);
|
pd->search_text = strdup(text);
|
||||||
pd->search_len = len;
|
pd->search_len = len;
|
||||||
if (!len && !pd->search_timer)
|
if (!len && !pd->search_timer)
|
||||||
|
|
Loading…
Reference in New Issue