code refactoring.
goto_close(), search_close() returns a result in order that the caller decides a next behavior.
This commit is contained in:
parent
5c23a5b661
commit
4d3c94cf64
|
@ -214,11 +214,11 @@ goto_is_opened(void)
|
|||
return (gd ? EINA_TRUE : EINA_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
Eina_Bool
|
||||
goto_close(void)
|
||||
{
|
||||
goto_data *gd = g_gd;
|
||||
if (!gd) return;
|
||||
if (!gd) return EINA_FALSE;
|
||||
|
||||
//Save last state
|
||||
evas_object_geometry_get(gd->win, NULL, NULL, &win_w, &win_h);
|
||||
|
@ -230,4 +230,6 @@ goto_close(void)
|
|||
g_gd = NULL;
|
||||
|
||||
tools_goto_update();
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -443,11 +443,11 @@ search_is_opened(void)
|
|||
return (sd ? EINA_TRUE : EINA_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
Eina_Bool
|
||||
search_close(void)
|
||||
{
|
||||
search_data *sd = g_sd;
|
||||
if (!sd) return;
|
||||
if (!sd) return EINA_FALSE;
|
||||
|
||||
Evas_Object *enventor = base_enventor_get();
|
||||
|
||||
|
@ -466,4 +466,6 @@ search_close(void)
|
|||
g_sd = NULL;
|
||||
|
||||
tools_search_update();
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ menu_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
live_edit_cancel();
|
||||
if (search_is_opened()) search_close();
|
||||
if (goto_is_opened()) tools_goto_update();
|
||||
search_close();
|
||||
tools_goto_update();
|
||||
|
||||
menu_toggle();
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ find_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
live_edit_cancel();
|
||||
if (search_is_opened()) search_close();
|
||||
if (search_close()) return;
|
||||
else search_open();
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ goto_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
live_edit_cancel();
|
||||
if (goto_is_opened()) goto_close();
|
||||
if (goto_close()) return;
|
||||
else goto_open();
|
||||
}
|
||||
|
||||
|
@ -90,8 +90,8 @@ static void
|
|||
live_edit_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
if (search_is_opened()) search_close();
|
||||
if (goto_is_opened()) goto_close();
|
||||
search_close();
|
||||
goto_close();
|
||||
live_edit_toggle();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define DEFAULT_GOTO_WIN_W 330
|
||||
#define DEFAULT_GOTO_WIN_H 77
|
||||
void goto_open(void);
|
||||
void goto_close(void);
|
||||
Eina_Bool goto_close(void);
|
||||
Eina_Bool goto_is_opened(void);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define DEFAULT_SEARCH_WIN_W 330
|
||||
#define DEFAULT_SEARCH_WIN_H 90
|
||||
void search_open(void);
|
||||
void search_close(void);
|
||||
Eina_Bool search_close(void);
|
||||
Eina_Bool search_is_opened(void);
|
||||
|
|
Loading…
Reference in New Issue