Create zarch_zui_render_root_load_free
This commit is contained in:
parent
a1effd5123
commit
774de49e4a
|
@ -592,6 +592,17 @@ static int zarch_zui_render_lay_root_recent(zui_t *zui, zui_tabbed_t *tabbed)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void zarch_zui_render_lay_root_load_free(zui_t *zui)
|
||||||
|
{
|
||||||
|
if (!zui)
|
||||||
|
return;
|
||||||
|
|
||||||
|
free(zui->load_cwd);
|
||||||
|
dir_list_free(zui->load_dlist);
|
||||||
|
zui->load_cwd = NULL;
|
||||||
|
zui->load_dlist = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static int zarch_zui_render_lay_root_load(zui_t *zui, zui_tabbed_t *tabbed)
|
static int zarch_zui_render_lay_root_load(zui_t *zui, zui_tabbed_t *tabbed)
|
||||||
{
|
{
|
||||||
char parent_dir[PATH_MAX_LENGTH];
|
char parent_dir[PATH_MAX_LENGTH];
|
||||||
|
@ -617,13 +628,7 @@ static int zarch_zui_render_lay_root_load(zui_t *zui, zui_tabbed_t *tabbed)
|
||||||
zarch_zui_draw_text(zui, ZUI_FG_NORMAL, 15, tabbed->tabline_size + 5 + 41, &zui->load_cwd[strlen(zui->load_cwd) - cwd_offset]);
|
zarch_zui_draw_text(zui, ZUI_FG_NORMAL, 15, tabbed->tabline_size + 5 + 41, &zui->load_cwd[strlen(zui->load_cwd) - cwd_offset]);
|
||||||
|
|
||||||
if (zarch_zui_button(zui, zui->width - 290 - 129, tabbed->tabline_size + 5, "Home"))
|
if (zarch_zui_button(zui, zui->width - 290 - 129, tabbed->tabline_size + 5, "Home"))
|
||||||
{
|
zarch_zui_render_lay_root_load_free(zui);
|
||||||
if (zui->load_cwd)
|
|
||||||
free(zui->load_cwd);
|
|
||||||
dir_list_free(zui->load_dlist);
|
|
||||||
zui->load_cwd = NULL;
|
|
||||||
zui->load_dlist = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (zui->load_dlist)
|
if (zui->load_dlist)
|
||||||
{
|
{
|
||||||
|
@ -647,10 +652,9 @@ static int zarch_zui_render_lay_root_load(zui_t *zui, zui_tabbed_t *tabbed)
|
||||||
for (i = 0; i < size; ++i)
|
for (i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
const char *basename = path_basename(zui->load_dlist->elems[i].data);
|
const char *basename = path_basename(zui->load_dlist->elems[i].data);
|
||||||
if (basename[0] == '.')
|
if (basename[0] != '.')
|
||||||
skip++;
|
|
||||||
else
|
|
||||||
break;
|
break;
|
||||||
|
skip++;
|
||||||
}
|
}
|
||||||
|
|
||||||
zui->load_dlist_first += zui->mouse.wheel;
|
zui->load_dlist_first += zui->mouse.wheel;
|
||||||
|
|
Loading…
Reference in New Issue